]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Non regression tests for MEDLoader.GetTypesOfField bug
authorgeay <anthony.geay@cea.fr>
Mon, 26 May 2014 05:52:46 +0000 (07:52 +0200)
committergeay <anthony.geay@cea.fr>
Mon, 26 May 2014 05:52:46 +0000 (07:52 +0200)
src/MEDLoader/Swig/MEDLoaderTest.py
src/MEDLoader/Test/MEDLoaderTest.cxx

index 99b174483b0b3776a40e99973860072235dfd3d3..7b50d9213959ea042257faa4ee4b311197dacafb 100644 (file)
@@ -315,6 +315,7 @@ class MEDLoaderTest(unittest.TestCase):
         fileName="Pyfile14.med";
         f1=MEDLoaderDataForTest.buildVecFieldOnGaussNE_1();
         MEDLoader.MEDLoader.WriteField(fileName,f1,True);
+        self.assertEqual([MEDLoader.ON_GAUSS_NE],MEDLoader.MEDLoader.GetTypesOfField(fileName,'2DMesh_2','MyFieldOnGaussNE')) #Bug 22/5/2014
         f2=MEDLoader.MEDLoader.ReadField(MEDLoader.ON_GAUSS_NE,fileName,f1.getMesh().getName(),0,f1.getName(),1,5);
         self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
         pass
index 4ff659f35e5becbac4989e7d0b2f79d6a1fdea70..138b35cd443667581774af5e5f5eb3e8ec01802f 100644 (file)
@@ -483,6 +483,9 @@ void MEDLoaderTest::testFieldGaussNERW1()
   const char fileName[]="file14.med";
   MEDCouplingFieldDouble *f1=buildVecFieldOnGaussNE_1();
   MEDLoader::WriteField(fileName,f1,true);
+  std::vector<ParaMEDMEM::TypeOfField> tof(MEDLoader::GetTypesOfField(fileName,"2DMesh_2","MyFieldOnGaussNE"));
+  CPPUNIT_ASSERT_EQUAL(1,(int)tof.size());
+  CPPUNIT_ASSERT(ON_GAUSS_NE==tof[0]);
   MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_NE,fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),1,5);
   CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
   f2->decrRef();