Salome HOME
Merge branch 'BR_2017' of https://git.salome-platform.org/gitpub/modules/hydro.git...
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_LandCoverMap.cxx
index 65a1d64f7613387d3680d6d353b244720ba67723..62d6a75f62750abaa00b381d63b12a67a52a2e3e 100644 (file)
@@ -807,7 +807,7 @@ void test_HYDROData_LandCoverMap::test_assign_to_calc_case()
 
   aDoc->Close();
 }
-#include <QTest>
+
 void test_HYDROData_LandCoverMap::test_shp_import_cyp()
 {
   //TestViewer::eraseAll(true);
@@ -826,7 +826,7 @@ void test_HYDROData_LandCoverMap::test_shp_import_cyp()
   Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
   HYDROData_MapOfFaceToStricklerType aMapFace2ST;
 
-  for ( int i = 1; i <= PolygonFaces.Length(); i++ )
+  for ( int i = 1; i <= 20; i++ )
   {
     TopoDS_Shape aShape = PolygonFaces(i);
     if ( aShape.IsNull() ) 
@@ -856,7 +856,7 @@ void test_HYDROData_LandCoverMap::test_shp_import_clc_dec()
   Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
   HYDROData_MapOfFaceToStricklerType aMapFace2ST;
 
-  for ( int i = 150; i <= 350; i++ )
+  for ( int i = 150; i <= 160; i++ )
   {
     TopoDS_Shape aShape = PolygonFaces(i);
     if ( aShape.IsNull() ) 
@@ -1077,7 +1077,6 @@ void test_HYDROData_LandCoverMap::test_split_2()
 
 void test_HYDROData_LandCoverMap::test_export_telemac()
 {
-  return;
   Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
 
   Handle(HYDROData_StricklerTable) aTable =
@@ -1087,18 +1086,26 @@ void test_HYDROData_LandCoverMap::test_export_telemac()
   Handle(HYDROData_LandCoverMap) aMap =
     Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
 
+  QStringList types = aTable->GetTypes();
+  //foreach( QString type, types )
+  //  std::cout << type.toStdString() << std::endl;
+
+  QString type7 = types[7];
+  QString type8 = types[8];
+  QString type9 = types[9];
+
   TopoDS_Face aLC1 = Face2d( QList<double>() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 );
-  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, QString::fromLatin1("Forêt et végétation arbustive en mutation")) );
+  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, type7 ) );
 
   TopoDS_Face aLC2 = Face2d( QList<double>() << 21 << 34 << 24 << 25 << 37   << 37 << 40  << 61 <<
                                               44 << 95 << 85 << 100 << 104 << 66 << 107 << 33 <<
                                              128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 <<
                                               31 << 114 );
-  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, QString::fromLatin1("Forêts de conifères")) );
+  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, type8 ) );
 
   TopoDS_Face aLC3 = Face2d( QList<double>() << 4 << 54 << 1   << 47 << 51  << 45 <<
                                             127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 );
-  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, QString::fromLatin1("Forêts de feuillus")) );
+  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, type9 ) );
 
   QString aTmpFileName = "test.telemac";
   QString aTmpPath = QDir::tempPath() + "/" + aTmpFileName;
@@ -1169,10 +1176,10 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_perf()
 
 #ifdef NDEBUG
   int SI = 100;
-  int EI = 300;
+  int EI = 110;
 #else
-  int SI = 150;
-  int EI = 200;
+  int SI = 100;
+  int EI = 110;
 #endif
 
   for ( int i = SI; i <= EI; i++ )