Salome HOME
HYDRO_tests corrections
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_LandCoverMap.cxx
index c7e3b4c7dc0568e790435d11eeb20c3af8622d72..e0e5c84c2b11fe98f3a76c0ee2d8d11d0b961e28 100644 (file)
@@ -60,18 +60,34 @@ void test_HYDROData_LandCoverMap::test_add_2_objects()
   CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() );
 
   TopoDS_Face aLC1 = Face( QList<double>() << 10 << 10 << 50 << 20 << 30 << 50 << 15 << 30 );
+  //DEBTRACE("--- ajout test1 " << aLC1);
   CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "test1" ) );
 
   TopoDS_Face aLC2 = Face( QList<double>() << 30 << 20 << 60 << 10 << 70 << 35 << 40 << 40 );
+  //DEBTRACE("--- ajout test2 " << aLC2);
   CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "test2" ) );
 
+  HYDROData_LandCoverMap::Explorer anIt( aMap );
+  CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
+  //DEBTRACE(anIt.Face() << " " << anIt.StricklerType());
+  CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
+  anIt.Next();
+  //DEBTRACE(anIt.Face() << " " << anIt.StricklerType());
+  CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
+  CPPUNIT_ASSERT_EQUAL( QString( "test2" ), anIt.StricklerType() );
+  anIt.Next();
+  CPPUNIT_ASSERT_EQUAL( false, anIt.More() );
+
+  //DEBTRACE("--- show")
   TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Add_2_Objects" );
   CPPUNIT_ASSERT_IMAGES
 
-  HYDROData_LandCoverMap::Explorer anIt( aMap );
+  anIt.Init(*aMap);
   CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
+  //DEBTRACE(anIt.Face() << " " << anIt.StricklerType());
   CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
   anIt.Next();
+  //DEBTRACE(anIt.Face() << " " << anIt.StricklerType());
   CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
   CPPUNIT_ASSERT_EQUAL( QString( "test2" ), anIt.StricklerType() );
   anIt.Next();
@@ -1071,17 +1087,17 @@ void test_HYDROData_LandCoverMap::test_export_telemac()
     Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
 
   TopoDS_Face aLC1 = Face( QList<double>() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 );
-  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Zones de champs cultivé à végétation basse" ) );
+  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Forêt et végétation arbustive en mutation" ) );
 
   TopoDS_Face aLC2 = Face( 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, "Zones de champs cultivé à végétation haute" ) );
+  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "Forêts de conifères" ) );
 
   TopoDS_Face aLC3 = Face( QList<double>() << 4 << 54 << 1   << 47 << 51  << 45 <<
                                             127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 );
-  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "Zones de champs, prairies, sans cultures" ) );
+  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "Forêts de feuillus" ) );
 
   QString aTmpFileName = "test.telemac";
   QString aTmpPath = QDir::tempPath() + "/" + aTmpFileName;
@@ -1100,10 +1116,10 @@ void test_HYDROData_LandCoverMap::test_copy()
   aMap->SetName( "map_1" );
 
   TopoDS_Face aLC1 = Face( QList<double>() << 10 << 10 << 30 << 10 << 20 << 20 );
-  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Zones de champs cultivé à végétation basse" ) );
+  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Forêts de conifères" ) );
 
   TopoDS_Face aLC2 = Face( QList<double>() << 110 << 10 << 130 << 10 << 120 << 20 );
-  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "Zones de champs cultivé à végétation haute" ) );
+  CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "Forêts de feuillus" ) );
 
   Handle(HYDROData_LandCoverMap) aMap2 =
     Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
@@ -1112,11 +1128,11 @@ void test_HYDROData_LandCoverMap::test_copy()
   CPPUNIT_ASSERT_EQUAL( QString( "map_2" ), aMap2->GetName() );
   HYDROData_LandCoverMap::Explorer anIt( aMap2 );
   CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
-  CPPUNIT_ASSERT_EQUAL( QString( "Zones de champs cultivé à végétation basse" ), anIt.StricklerType() );
+  CPPUNIT_ASSERT_EQUAL( QString( "Forêts de conifères" ), anIt.StricklerType() );
   CPPUNIT_ASSERT( anIt.Face().TShape()!=aLC1.TShape() );
   anIt.Next();
   CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
-  CPPUNIT_ASSERT_EQUAL( QString( "Zones de champs cultivé à végétation haute" ), anIt.StricklerType() );
+  CPPUNIT_ASSERT_EQUAL( QString( "Forêts de feuillus" ), anIt.StricklerType() );
   CPPUNIT_ASSERT( anIt.Face().TShape()!=aLC2.TShape() );
   anIt.Next();
   CPPUNIT_ASSERT_EQUAL( false, anIt.More() );