From: abn Date: Mon, 28 Sep 2020 09:49:17 +0000 (+0200) Subject: MEDCouplingFieldInt should always be filled with DAInt32 ... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fabn%2Fportability;p=tools%2Fmedcoupling.git MEDCouplingFieldInt should always be filled with DAInt32 ... --- diff --git a/src/MEDLoader/Swig/MEDLoaderDataForTest.py b/src/MEDLoader/Swig/MEDLoaderDataForTest.py index 3fd2f7b38..348247b38 100644 --- a/src/MEDLoader/Swig/MEDLoaderDataForTest.py +++ b/src/MEDLoader/Swig/MEDLoaderDataForTest.py @@ -415,7 +415,7 @@ class MEDLoaderDataForTest: f1=MEDCouplingFieldInt.New(ON_CELLS,ONE_TIME); f1.setName("IntVectorFieldOnCells"); f1.setMesh(mesh); - array=DataArrayInt([0,10,20,1,11,21,2,12,22,3,13,23,4,14,24,5,15,25],nbOfCells ,3) + array=DataArrayInt32([0,10,20,1,11,21,2,12,22,3,13,23,4,14,24,5,15,25],nbOfCells ,3) array.setInfoOnComponent(0,"va1 [MW/m^3]"); array.setInfoOnComponent(1,"va2 [g/cm^3]"); array.setInfoOnComponent(2,"val3 [K]"); diff --git a/src/MEDLoader/Swig/MEDLoaderTest1.py b/src/MEDLoader/Swig/MEDLoaderTest1.py index 41455fb3c..248b00f56 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest1.py +++ b/src/MEDLoader/Swig/MEDLoaderTest1.py @@ -114,7 +114,7 @@ class MEDLoaderTest1(unittest.TestCase): f2_int=MEDLoader.ReadFieldCell(fileName,f1_int.getMesh().getName(),0,f1_int.getName(),8,9); self.assertTrue(f1_int.isEqual(f2_int,1e-12,0)); # exact comparison here f2_fl=MEDLoader.ReadFieldCell(fileName,f1_fl.getMesh().getName(),0,f1_fl.getName(),8,9); - self.assertTrue(f1_fl.isEqual(f2_fl,1e-12,1e-12)); + self.assertTrue(f1_fl.isEqual(f2_fl,1e-12,1e-7)); # float comparison here #ON NODES f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1(); fileName2="Pyfile9.med"; diff --git a/src/MEDLoader/Test/MEDLoaderTest.cxx b/src/MEDLoader/Test/MEDLoaderTest.cxx index 6a7480ddf..4067c1975 100644 --- a/src/MEDLoader/Test/MEDLoaderTest.cxx +++ b/src/MEDLoader/Test/MEDLoaderTest.cxx @@ -158,9 +158,11 @@ void MEDLoaderTest::testFieldRW2() MEDCouplingFieldInt *f2_int=dynamic_cast(ReadFieldCell(fileName,f1_int->getMesh()->getName().c_str(),0,f1_int->getName().c_str(),8,9)); CPPUNIT_ASSERT(f1_int->isEqual(f2_int,1e-12,0)); // exact equality for int values f2_int->decrRef(); + f1_int->decrRef(); MEDCouplingFieldFloat *f2_fl=dynamic_cast(ReadFieldCell(fileName,f1_fl->getMesh()->getName().c_str(),0,f1_fl->getName().c_str(),8,9)); - CPPUNIT_ASSERT(f1_fl->isEqual(f2_fl,1e-12,1e-12)); + CPPUNIT_ASSERT(f1_fl->isEqual(f2_fl,1e-12,1e-07f)); // float comparison f2_fl->decrRef(); + f1_fl->decrRef(); //ON NODES f1=buildVecFieldOnNodes_1(); const char fileName2[]="file9.med"; @@ -1408,7 +1410,7 @@ MEDCouplingFieldInt *MEDLoaderTest::buildIntVecFieldOnCells_1() MEDCouplingFieldInt *f1=MEDCouplingFieldInt::New(ON_CELLS,ONE_TIME); f1->setName("IntVectorFieldOnCells"); f1->setMesh(mesh); - DataArrayInt *array=DataArrayInt::New(); + DataArrayInt32 *array=DataArrayInt32::New(); array->alloc(nbOfCells,3); array->setInfoOnComponent(0,"val1 [MW/m^3]"); array->setInfoOnComponent(1,"va2 [g/cm^3]");