Salome HOME
Merge branch 'V9_3_BR'
[tools/medcoupling.git] / src / MEDLoader / Test / SauvLoaderTest.cxx
index 22f86515cc4379bcc360d1abd70a70311d1fcb5b..018317f95961600b34649bafaa7006fb83591de2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019  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
@@ -251,11 +251,11 @@ void SauvLoaderTest::testMed2Sauv()
   CPPUNIT_ASSERT( std::find(groups.begin(),groups.end(),"maa1") != groups.end() );
   CPPUNIT_ASSERT_EQUAL(16,m->getSizeAtLevel(0));
   MCAuto<MEDCouplingMesh> um0 = m->getMeshAtLevel(0);
-  CPPUNIT_ASSERT_EQUAL(12, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TETRA4 ));
-  CPPUNIT_ASSERT_EQUAL(2,  um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_PYRA5 ));
-  CPPUNIT_ASSERT_EQUAL(2,  um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_HEXA8 ));
+  CPPUNIT_ASSERT_EQUAL(12, (int)um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TETRA4 ));
+  CPPUNIT_ASSERT_EQUAL(2,  (int)um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_PYRA5 ));
+  CPPUNIT_ASSERT_EQUAL(2,  (int)um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_HEXA8 ));
   MCAuto<MEDCouplingMesh> um1 = m->getMeshAtLevel(-1);
-  CPPUNIT_ASSERT_EQUAL(1, um1->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 ));
+  CPPUNIT_ASSERT_EQUAL(1, (int)um1->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 ));
   //CPPUNIT_ASSERT_EQUAL(2, um1->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 ));
   MCAuto<MEDCouplingUMesh> pointeUM0 =
     static_cast<MEDCouplingUMesh*>( pointeMedMesh->getMeshAtLevel(0));
@@ -337,7 +337,11 @@ void SauvLoaderTest::testCellsWithLingNames()
 void SauvLoaderTest::tearDown()
 {
   const int nbFilesToRemove = 3;
+#if defined(WIN32) && defined(UNICODE)
+  const wchar_t* fileToRemove[nbFilesToRemove] = { L"allPillesTest.med", L"pointe.sauv", L"mesh_with_void_family.sauv" };
+#else
   const char* fileToRemove[nbFilesToRemove] = { "allPillesTest.med", "pointe.sauv", "mesh_with_void_family.sauv" };
+#endif
   for ( int i = 0; i < nbFilesToRemove; ++i )
   {
 #ifdef WIN32
@@ -345,6 +349,10 @@ void SauvLoaderTest::tearDown()
 #else
       if (access(fileToRemove[i], F_OK) == 0)
 #endif
+#if defined(WIN32) && defined(UNICODE)
+               _wremove(fileToRemove[i]);
+#else
         remove(fileToRemove[i]);
+#endif
   }
 }