Salome HOME
Merge branch 'master' of https://git.salome-platform.org/git/modules/med
[tools/medcoupling.git] / src / MEDLoader / Test / SauvLoaderTest.cxx
index 1f90c7beacd573a42dabe63cdf40059adbfb6a2b..b6195f6df1abfefeea187b429a92e2c50e308779 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -113,10 +113,10 @@ void SauvLoaderTest::testMed2SauvOnAMeshWithVoidFamily()
   MEDCouplingAutoRefCountObjectPtr<SauvReader> sr=SauvReader::New(sauvFile);
   MEDCouplingAutoRefCountObjectPtr<MEDFileData> d2=sr->loadInMEDFileDS();
   MEDFileUMesh* m2 = static_cast<MEDFileUMesh*>( d2->getMeshes()->getMeshAtPos(0) );
-  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> grp1 = m2->getGroup(0, "Group1");
-  CPPUNIT_ASSERT_EQUAL(1,(int)grp1->getNumberOfCells());
-  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> grp2 = m2->getGroup(0, "Group2");
-  CPPUNIT_ASSERT_EQUAL(1,(int)grp2->getNumberOfCells());
+  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> group1 = m2->getGroup(0, "Group1");
+  CPPUNIT_ASSERT_EQUAL(1,(int)group1->getNumberOfCells());
+  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> group2 = m2->getGroup(0, "Group2");
+  CPPUNIT_ASSERT_EQUAL(1,(int)group2->getNumberOfCells());
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> grptot = m2->getGroup(0, "Grouptot");
   CPPUNIT_ASSERT_EQUAL(2,(int)grptot->getNumberOfCells());
 }
@@ -192,6 +192,7 @@ void SauvLoaderTest::testMed2Sauv()
   // add a field on 2 faces to pointeMed
   MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ff1=MEDFileFieldMultiTS::New();
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=MEDCouplingFieldDouble::New(ON_GAUSS_NE,ONE_TIME);
+  f1->setMesh( pointeM1D );
   f1->setName("Field on 2 faces");
   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> d=DataArrayDouble::New();
   d->alloc(3+4,2);
@@ -208,8 +209,6 @@ void SauvLoaderTest::testMed2Sauv()
     {
       0,2
     };
-  MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> pointeM1D_part=pointeM1D->buildPartOfMySelf(ids,ids+2,true);
-  f1->setMesh( pointeM1D_part );
   da->alloc(2,1);
   std::copy(ids,ids+da->getNbOfElems(),da->getPointer());
   da->setName("sup2");
@@ -307,7 +306,7 @@ void SauvLoaderTest::testMed2Sauv()
     }
   // "Field on 2 faces"
   MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> fieldOnFaces =
-    dynamic_cast<MEDFileFieldMultiTS *>(d2->getFields()->getFieldWithName(f1->getName()));
+    dynamic_cast<MEDFileFieldMultiTS *>(d2->getFields()->getFieldWithName(f1->getName().c_str()));
   io1 = fieldOnFaces->getIterations();
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fof =
     fieldOnFaces->getFieldOnMeshAtLevel(f1->getTypeOfField(),io1[0].first,io1[0].second,um1);
@@ -334,7 +333,7 @@ std::string SauvLoaderTest::getResourceFile( const std::string& filename )
   std::string resourceFile = "";
 
   if ( getenv("top_srcdir") ) {
-    // we are in 'make check' step
+    // we are in 'make test' step
     resourceFile = getenv("top_srcdir");
     resourceFile += "/resources/";
   }