/[escript]/trunk/escript/test/python/test_objects.py
ViewVC logotype

Diff of /trunk/escript/test/python/test_objects.py

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

revision 1033 by gross, Tue Mar 13 05:43:36 2007 UTC revision 1034 by gross, Wed Mar 14 23:49:20 2007 UTC
# Line 662  class Test_Dump(unittest.TestCase): Line 662  class Test_Dump(unittest.TestCase):
662            d.setTaggedValue(10,self.arg4*3)            d.setTaggedValue(10,self.arg4*3)
663            d.setTaggedValue(100,self.arg4*4)            d.setTaggedValue(100,self.arg4*4)
664            self._diffDataObjects(d,file)            self._diffDataObjects(d,file)
665       #===========================================================================
666       def test_SetDataPointValue_Function_Rank0(self):
667              d=Data(self.arg0,Function(self.domain))
668              d.setValueOfDataPoint(0,self.arg0*2)
669              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
670              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg0)
671              d_0=d.getValueOfDataPoint(0)
672              d_1=d.getValueOfDataPoint(1)
673              self.failUnless(Lsup(d_0-self.arg0*2)<=Lsup(self.arg0*2), "wrong setting")
674              self.failUnless(Lsup(d_1-self.arg0)<=Lsup(self.arg0), "wrong setting")
675       def test_SetDataPointValue_Function_Rank1(self):
676              d=Data(self.arg1,Function(self.domain))
677              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
678              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
679              d.setValueOfDataPoint(0,self.arg1*2)
680              d_0=d.getValueOfDataPoint(0)
681              d_1=d.getValueOfDataPoint(1)
682              self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
683              self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
684       def test_SetDataPointValue_Function_Rank1_list(self):
685              d=Data(self.arg1,Function(self.domain))
686              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg2)
687              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg1)
688              d.setValueOfDataPoint(0,numarray.array2list(self.arg1*2))
689              d_0=d.getValueOfDataPoint(0)
690              d_1=d.getValueOfDataPoint(1)
691              self.failUnless(Lsup(d_0-self.arg1*2)<=Lsup(self.arg1*2), "wrong setting")
692              self.failUnless(Lsup(d_1-self.arg1)<=Lsup(self.arg1), "wrong setting")
693       def test_SetDataPointValue_Function_Rank2(self):
694              d=Data(self.arg2,Function(self.domain))
695              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
696              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
697              d.setValueOfDataPoint(0,self.arg2*2)
698              d_0=d.getValueOfDataPoint(0)
699              d_1=d.getValueOfDataPoint(1)
700              self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
701              self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
702       def test_SetDataPointValue_Function_Rank2_list(self):
703              d=Data(self.arg2,Function(self.domain))
704              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
705              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg2)
706              d.setValueOfDataPoint(0,numarray.array2list(self.arg2*2))
707              d_0=d.getValueOfDataPoint(0)
708              d_1=d.getValueOfDataPoint(1)
709              self.failUnless(Lsup(d_0-self.arg2*2)<=Lsup(self.arg2*2), "wrong setting")
710              self.failUnless(Lsup(d_1-self.arg2)<=Lsup(self.arg2), "wrong setting")
711       def test_SetDataPointValue_Function_Rank3(self):
712              d=Data(self.arg3,Function(self.domain))
713              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
714              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
715              d.setValueOfDataPoint(0,self.arg3*2)
716              d_0=d.getValueOfDataPoint(0)
717              d_1=d.getValueOfDataPoint(1)
718              self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
719              self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
720       def test_SetDataPointValue_Function_Rank3_list(self):
721              d=Data(self.arg3,Function(self.domain))
722              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
723              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg3)
724              d.setValueOfDataPoint(0,numarray.array2list(self.arg3*2))
725              d_0=d.getValueOfDataPoint(0)
726              d_1=d.getValueOfDataPoint(1)
727              self.failUnless(Lsup(d_0-self.arg3*2)<=Lsup(self.arg3*2), "wrong setting")
728              self.failUnless(Lsup(d_1-self.arg3)<=Lsup(self.arg3), "wrong setting")
729       def test_SetDataPointValue_Function_Rank4(self):
730              d=Data(self.arg4,Function(self.domain))
731              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
732              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
733              d.setValueOfDataPoint(0,self.arg4*2)
734              d_0=d.getValueOfDataPoint(0)
735              d_1=d.getValueOfDataPoint(1)
736              self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
737              self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")
738       def test_SetDataPointValue_Function_Rank4_list(self):
739              d=Data(self.arg4,Function(self.domain))
740              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, 0, self.arg1)
741              self.failUnlessRaises(RuntimeError, d.setValueOfDataPoint, -1, self.arg4)
742              d.setValueOfDataPoint(0,numarray.array2list(self.arg4*2))
743              d_0=d.getValueOfDataPoint(0)
744              d_1=d.getValueOfDataPoint(1)
745              self.failUnless(Lsup(d_0-self.arg4*2)<=Lsup(self.arg4*2), "wrong setting")
746              self.failUnless(Lsup(d_1-self.arg4)<=Lsup(self.arg4), "wrong setting")

Legend:
Removed from v.1033  
changed lines
  Added in v.1034

  ViewVC Help
Powered by ViewVC 1.1.26