/[escript]/trunk/escriptcore/test/python/test_shared.py
ViewVC logotype

Diff of /trunk/escriptcore/test/python/test_shared.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/arrexp_2137_win/escript/test/python/test_shared.py revision 2212 by jfenwick, Wed Jan 14 00:15:00 2009 UTC trunk/escript/test/python/test_shared.py revision 3551 by jfenwick, Fri Aug 19 03:53:41 2011 UTC
# Line 1  Line 1 
1    
2  ########################################################  ########################################################
3  #  #
4  # Copyright (c) 2003-2008 by University of Queensland  # Copyright (c) 2003-2010 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
6  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
7  #  #
# Line 11  Line 11 
11  #  #
12  ########################################################  ########################################################
13    
14  __copyright__="""Copyright (c) 2003-2008 by University of Queensland  __copyright__="""Copyright (c) 2003-2010 by University of Queensland
15  Earth Systems Science Computational Center (ESSCC)  Earth Systems Science Computational Center (ESSCC)
16  http://www.uq.edu.au/esscc  http://www.uq.edu.au/esscc
17  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
18  __license__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
19  http://www.opensource.org/licenses/osl-3.0.php"""  http://www.opensource.org/licenses/osl-3.0.php"""
20  __url__="http://www.uq.edu.au/esscc/escript-finley"  __url__="https://launchpad.net/escript-finley"
21    
22  """  """
23  Test to ensure that modification of shared Data does not occur  Test to ensure that modification of shared Data does not occur
# Line 31  class Test_Shared(unittest.TestCase): Line 31  class Test_Shared(unittest.TestCase):
31      d=Data(42)      d=Data(42)
32      e=d.delay()      e=d.delay()
33      d.setToZero()      d.setToZero()
34      self.failUnless(Lsup(e-42)<=self.tol)      self.assertTrue(Lsup(e-42)<=self.tol)
35            
36    def test_copyConstr(self):    def test_copyConstr(self):
37      d=Data(42)      d=Data(42)
38      e=Data(d)      e=Data(d)
39      d+=17      d+=17
40      self.failUnless(Lsup(e-42)<=self.tol)      self.assertTrue(Lsup(e-42)<=self.tol)
41            
42    # This should not fail (even in the old code) but it doesn't hurt to check    # This should not fail (even in the old code) but it doesn't hurt to check
43    def test_Copy(self):    def test_Copy(self):
44      d=Data(42)      d=Data(42)
45      e=d.copy()      e=d.copy()
46      d+=17      d+=17
47      self.failUnless(Lsup(e-42)<=self.tol)      self.assertTrue(Lsup(e-42)<=self.tol)
48            
49    def  test_eqops(self):    def  test_eqops(self):
50      d=Data(42)      d=Data(42)
51      e=d.delay()      e=d.delay()
52      d+=17      d+=17
53      self.failUnless(Lsup(e-42)<=self.tol)      self.assertTrue(Lsup(e-42)<=self.tol)
54      d=Data(42)      d=Data(42)
55      e=d.delay()      e=d.delay()
56      d-=1      d-=1
57      self.failUnless(Lsup(e-42)<=self.tol)      self.assertTrue(Lsup(e-42)<=self.tol)
58      d*=3      d*=3
59      d=Data(42)      d=Data(42)
60      e=d.delay()      e=d.delay()
61      d/=2      d/=2
62      self.failUnless(Lsup(e-42)<=self.tol)      self.assertTrue(Lsup(e-42)<=self.tol)
63            
64    def test_setItem(self):    def test_setItem(self):
65      d=Data(42)      d=Data(42)
66      e=d.delay()      e=d.delay()
67      d[tuple()]=17      d[tuple()]=17
68      self.failUnless(Lsup(e-42)<=self.tol)      self.assertTrue(Lsup(e-42)<=self.tol)
69    
70    
71    def test_setTaggedValue(self):    def test_setTaggedValue(self):
# Line 75  class Test_Shared(unittest.TestCase): Line 75  class Test_Shared(unittest.TestCase):
75      e=d.delay()      e=d.delay()
76      d.setTaggedValue("TestTag",17)      d.setTaggedValue("TestTag",17)
77      e.resolve()      e.resolve()
78      self.failUnless(str(e)!=str(d))      self.assertTrue(str(e)!=str(d))
79      e=d.delay()      e=d.delay()
80      d.setTaggedValue(1,12)      d.setTaggedValue(1,12)
81      e.resolve()      e.resolve()
82      self.failUnless(str(e)!=str(d))      self.assertTrue(str(e)!=str(d))
83    
84    
85            

Legend:
Removed from v.2212  
changed lines
  Added in v.3551

  ViewVC Help
Powered by ViewVC 1.1.26