/[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 1869 by gross, Tue Oct 7 07:10:47 2008 UTC revision 1870 by gross, Thu Oct 9 08:49:53 2008 UTC
# Line 364  class Test_Dump(unittest.TestCase): Line 364  class Test_Dump(unittest.TestCase):
364    
365     def _diffDataObjects(self,d_ref,filemame, use_old_file=False):     def _diffDataObjects(self,d_ref,filemame, use_old_file=False):
366         if not use_old_file: d_ref.dump(filemame)         if not use_old_file: d_ref.dump(filemame)
367         d=load(filemame, self.domain)         d=load(filemame, d_ref.getDomain())
368         self.failUnless(not d.isEmpty(),"data in %s are empty."%filemame)         self.failUnless(not d.isEmpty(),"data in %s are empty."%filemame)
        self.failUnless(d_ref.getFunctionSpace() == d.getFunctionSpace(), "wrong function space in %s."%filemame)  
369         self.failUnless(d_ref.getRank() == d.getRank(), "different rank in %s. "%filemame)         self.failUnless(d_ref.getRank() == d.getRank(), "different rank in %s. "%filemame)
370         self.failUnless(d_ref.getShape() == d.getShape(), "different shape %s. "%filemame)         self.failUnless(d_ref.getShape() == d.getShape(), "different shape %s. "%filemame)
371           self.failUnless(d_ref.getFunctionSpace() == d.getFunctionSpace(), "wrong function space in %s."%filemame)
372         self.failUnless(Lsup(d_ref-d)<=0., "different entries %s."%filemame)         self.failUnless(Lsup(d_ref-d)<=0., "different entries %s."%filemame)
373    
374     #===========================================================================     #===========================================================================
# Line 584  class Test_Dump(unittest.TestCase): Line 584  class Test_Dump(unittest.TestCase):
584         if loadIsConfigured():         if loadIsConfigured():
585            filemame=os.path.join(self.filename_base,"expanded_solution_rank0.nc")            filemame=os.path.join(self.filename_base,"expanded_solution_rank0.nc")
586            d=Data(length(Solution(self.domain).getX())*self.arg0,Solution(self.domain))            d=Data(length(Solution(self.domain).getX())*self.arg0,Solution(self.domain))
587              self._diffDataObjects(d,filemame)
588            self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)            self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_samples)
589            self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)            self.failUnlessRaises(RuntimeError, load, filemame, self.domain_with_different_number_of_data_points_per_sample)
590            if getMPISizeWorld() ==1:            if getMPISizeWorld() ==1:

Legend:
Removed from v.1869  
changed lines
  Added in v.1870

  ViewVC Help
Powered by ViewVC 1.1.26