Salome HOME
Reduced version of INTERPKernel tests can be run in MICROMED mode.
[tools/medcoupling.git] / src / MEDLoader / Test / MEDLoaderTest.cxx
index 0eb08c20600419725568319291807e3889fd27f8..85f0add7887f8d8d3a9590ace9bbc747397600cd 100644 (file)
@@ -24,6 +24,7 @@
 #include "MEDCouplingUMesh.hxx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "MEDCouplingMemArray.hxx"
+#include "TestInterpKernelUtils.hxx"  // getResourceFile()
 
 #include <cmath>
 #include <numeric>
@@ -777,7 +778,7 @@ void MEDLoaderTest::testMEDLoaderRead1()
   using namespace std;
   using namespace INTERP_KERNEL;
 
-  string fileName=getResourceFile("pointe.med");
+  string fileName= INTERP_TEST::getResourceFile("pointe.med", 3);
   vector<string> meshNames=MEDLoader::GetMeshNames(fileName.c_str());
   CPPUNIT_ASSERT_EQUAL(1,(int)meshNames.size());
   MEDCouplingUMesh *mesh=MEDLoader::ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),0);
@@ -1001,7 +1002,7 @@ void MEDLoaderTest::testMEDLoaderPolygonRead()
   using namespace std;
   using namespace INTERP_KERNEL;
 
-  string fileName=getResourceFile("polygones.med");
+  string fileName=INTERP_TEST::getResourceFile("polygones.med", 3);
   vector<string> meshNames=MEDLoader::GetMeshNames(fileName.c_str());
   CPPUNIT_ASSERT_EQUAL(1,(int)meshNames.size());
   CPPUNIT_ASSERT(meshNames[0]=="Bord");
@@ -1067,7 +1068,7 @@ void MEDLoaderTest::testMEDLoaderPolyhedronRead()
   using namespace std;
   using namespace INTERP_KERNEL;
 
-  string fileName=getResourceFile("poly3D.med");
+  string fileName=INTERP_TEST::getResourceFile("poly3D.med", 3);
   vector<string> meshNames=MEDLoader::GetMeshNames(fileName.c_str());
   CPPUNIT_ASSERT_EQUAL(1,(int)meshNames.size());
   CPPUNIT_ASSERT(meshNames[0]=="poly3D");
@@ -1146,25 +1147,6 @@ void MEDLoaderTest::testMEDLoaderPolyhedronRead()
   mesh->decrRef();
 }
 
-std::string MEDLoaderTest::getResourceFile( const std::string& filename ) const
-{
-  std::string resourceFile = "";
-
-  if ( getenv("top_srcdir") ) {
-    // we are in 'make test' step
-    resourceFile = getenv("top_srcdir");
-    resourceFile += "/resources/";
-  }
-  else if ( getenv("MED_ROOT_DIR") ) {
-    // use MED_ROOT_DIR env.var
-    resourceFile = getenv("MED_ROOT_DIR");
-    resourceFile += "/share/salome/resources/med/";
-  }
-  resourceFile += filename;
-  return resourceFile;
-}
-
-
 MEDCouplingUMesh *MEDLoaderTest::build1DMesh_1()
 {
   double coords[6]={ 0.0, 0.3, 0.75, 1.0, 1.4, 1.3 };