/[escript]/trunk/finley/test/python/test_utilframe.py
ViewVC logotype

Diff of /trunk/finley/test/python/test_utilframe.py

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

revision 588 by gross, Wed Dec 21 22:43:48 2005 UTC revision 589 by gross, Fri Mar 10 06:28:35 2006 UTC
# Line 13  class Test_util2(unittest.TestCase): Line 13  class Test_util2(unittest.TestCase):
13     def setUp(self):     def setUp(self):
14         self.__dom =Rectangle(10,10,2)         self.__dom =Rectangle(10,10,2)
15         self.functionspace = FunctionOnBoundary(self.__dom) # due to a bug in escript python needs to hold a reference to the domain         self.functionspace = FunctionOnBoundary(self.__dom) # due to a bug in escript python needs to hold a reference to the domain
16       def test_add_overloaded_constData_rank1_taggedData_rank0(self):
17     def test_wherePositive_array_rank0(self):         arg0=Data(numarray.array([4.5897569702707663, 3.4489828945022865]),self.functionspace)
18        arg=numarray.array(-15.0739210922)         arg1=Data(0.812494849561,self.functionspace)
19        res=wherePositive(arg)         arg1.setTaggedValue(1,-0.798066999908)
20        ref=numarray.array(0.0)         print arg0
21        print res         print arg1
22        if isinstance(res,numarray.NumArray):         res=arg0+arg1
23           self.failUnlessEqual(res.shape,(),"wrong shape of result.")         print res
24        else:         ref=Data(numarray.array([5.4022518198315126, 4.2614777440630327]),self.functionspace)
25           self.failUnless(isinstance(res,float),"wrong type of result.")         ref.setTaggedValue(1,numarray.array([3.7916899703627909, 2.650915894594311]))
26        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")         self.failUnless(isinstance(res,Data),"wrong type of result.")
27           self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
28           self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
29  if __name__ == '__main__':  if __name__ == '__main__':
30     suite = unittest.TestSuite()     suite = unittest.TestSuite()
31     suite.addTest(unittest.makeSuite(Test_util2))     suite.addTest(unittest.makeSuite(Test_util2))

Legend:
Removed from v.588  
changed lines
  Added in v.589

  ViewVC Help
Powered by ViewVC 1.1.26