From bafbb3101f9efa0a0eeb2d957e0ff0019000d762 Mon Sep 17 00:00:00 2001 From: geay Date: Mon, 26 May 2014 07:52:46 +0200 Subject: [PATCH] Non regression tests for MEDLoader.GetTypesOfField bug --- src/MEDLoader/Swig/MEDLoaderTest.py | 1 + src/MEDLoader/Test/MEDLoaderTest.cxx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/MEDLoader/Swig/MEDLoaderTest.py b/src/MEDLoader/Swig/MEDLoaderTest.py index 99b174483..7b50d9213 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest.py +++ b/src/MEDLoader/Swig/MEDLoaderTest.py @@ -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 diff --git a/src/MEDLoader/Test/MEDLoaderTest.cxx b/src/MEDLoader/Test/MEDLoaderTest.cxx index 4ff659f35..138b35cd4 100644 --- a/src/MEDLoader/Test/MEDLoaderTest.cxx +++ b/src/MEDLoader/Test/MEDLoaderTest.cxx @@ -483,6 +483,9 @@ void MEDLoaderTest::testFieldGaussNERW1() const char fileName[]="file14.med"; MEDCouplingFieldDouble *f1=buildVecFieldOnGaussNE_1(); MEDLoader::WriteField(fileName,f1,true); + std::vector 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(); -- 2.39.2