Changeset 2026


Ignore:
Timestamp:
Nov 14, 2005, 4:29:34 PM (18 years ago)
Author:
duncan
Message:

difference in results from windows and linux

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pmesh/test_triangmodule.py

    r2025 r2026  
    22#
    33
     4import sys
     5
    46import unittest
    57import triang
     8
    69
    710class triangTestCase(unittest.TestCase):
     
    144147        data = triang.genMesh(points,seglist,holelist,regionlist,
    145148                              pointattlist,segattlist, trilist, mode)
     149       
    146150        self.failUnless(len(data['generatedtrianglelist']) == 2,
    147151                        'testregion_with_maxarea 1: # of tris is wrong!')
    148152        ## Another test case   
    149153        regionlist = [(3,1,1.0),(1,3,1.0,8.0)]
    150         mode = "Qzpna36a"
    151         data = triang.genMesh(points,seglist,holelist,regionlist,
    152                               pointattlist,segattlist, trilist, mode)
    153         self.failUnless(len(data['generatedtrianglelist']) == 6,
     154        mode = "Qzp21na36a"
     155        data = triang.genMesh(points,seglist,holelist,regionlist,
     156                              pointattlist,segattlist, trilist, mode)
     157        #print "len(data['generatedtrianglelist']",len(data['generatedtrianglelist'])
     158        # On unix this returns a 7 triangle result.
     159        # Windows returns a 6 triangle result.
     160        if sys.platform == 'win32':  #Windows
     161            self.failUnless(len(data['generatedtrianglelist']) == 6,
     162                        'testregion_with_maxarea 2: # of tris is wrong!')
     163        else:
     164            self.failUnless(len(data['generatedtrianglelist']) == 7,
    154165                        'testregion_with_maxarea 2: # of tris is wrong!')
    155166        ## Another test case   
     
    158169        data = triang.genMesh(points,seglist,holelist,regionlist,
    159170                              pointattlist,segattlist, trilist, mode)
    160         self.failUnless(len(data['generatedtrianglelist']) == 8,
     171        #print "len(data['generatedtrianglelist']",len(data['generatedtrianglelist'])
     172        # On unix this returns a 10 triangle result.
     173        # Windows returns a 8 triangle result.
     174        if sys.platform == 'win32':  #Windows
     175            self.failUnless(len(data['generatedtrianglelist']) == 8,
     176                        'testregion_with_maxarea 3: # of tris is wrong!')
     177        else:
     178            self.failUnless(len(data['generatedtrianglelist']) == 10,
    161179                        'testregion_with_maxarea 3: # of tris is wrong!')
    162180                 
     
    166184        data = triang.genMesh(points,seglist,holelist,regionlist,
    167185                              pointattlist,segattlist, trilist, mode)
    168         self.failUnless(len(data['generatedtrianglelist']) == 8,
     186        #print "len(data['generatedtrianglelist']",len(data['generatedtrianglelist'])
     187        # On unix this returns a 10 triangle result.
     188        # Windows returns a 8 triangle result.
     189       
     190        if sys.platform == 'win32':  #Windows
     191            self.failUnless(len(data['generatedtrianglelist']) == 10,
     192                        'testregion_with_maxarea 4: # of tris is wrong!')
     193        else:
     194            self.failUnless(len(data['generatedtrianglelist']) == 10,
    169195                        'testregion_with_maxarea 4: # of tris is wrong!')
    170196                 
Note: See TracChangeset for help on using the changeset viewer.