Salome HOME
simple test for DBF info of polylines
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_StricklerTable.cxx
index c3248c5428868f0ac3d6faa2a01d2ad873cf2875..bfc5403733f7860e8485b7f23eb0b689e1539c0e 100644 (file)
@@ -28,7 +28,8 @@
 #include <QStringList>
 #include <QTableWidget>
 
-const QString DEF_STR_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/share/salome/resources/hydro/def_strickler_table.txt";
+const QString DEF_STR_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/share/salome/resources/hydro/def_strickler_table_06.txt";
+extern QString TMP_DIR;
 
 void test_HYDROData_StricklerTable::test_import()
 {
@@ -43,15 +44,15 @@ void test_HYDROData_StricklerTable::test_import()
   CPPUNIT_ASSERT_EQUAL( 44, aTypes.size() );
   CPPUNIT_ASSERT_EQUAL( QString( "CODE_06" ), aTable->GetAttrName() );
 
-  QString aType = "Périmètres irrigués en permanence";
+  QString aType = QString::fromUtf8("Périmètres irrigués en permanence");
   CPPUNIT_ASSERT_EQUAL( aType, aTypes[25] );
   CPPUNIT_ASSERT_EQUAL( QColor( 255, 255, 0 ), aTable->GetColor( aType ) );
   CPPUNIT_ASSERT_EQUAL( QString( "212" ), aTable->GetAttrValue( aType ) );
 
-  aType = "Végétation clairsemée";
+  aType = QString::fromUtf8("Végétation clairsemée");
   CPPUNIT_ASSERT_EQUAL( aType, aTypes[38] );
-  CPPUNIT_ASSERT_EQUAL( QColor( 164, 25, 164 ), aTable->GetColor( aType ) );
-  CPPUNIT_ASSERT_EQUAL( QString( "" ), aTable->GetAttrValue( aType ) );
+  CPPUNIT_ASSERT_EQUAL( QColor( 204, 255, 204 ), aTable->GetColor( aType ) );
+  CPPUNIT_ASSERT_EQUAL( QString( "333" ), aTable->GetAttrValue( aType ) );
 
   aDoc->Close();
 }
@@ -64,7 +65,7 @@ void test_HYDROData_StricklerTable::test_import_export_equivalence()
     Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) );
 
   CPPUNIT_ASSERT_EQUAL( true, aTable->Import( DEF_STR_PATH ) );
-  QString aTmpPath = QDir::tempPath() + "/stricker.txt";
+  QString aTmpPath = TMP_DIR + "/stricker.txt";
   CPPUNIT_ASSERT_EQUAL( true, aTable->Export( aTmpPath ) );
 
   QFile aRefFile( DEF_STR_PATH ), aTmpFile( aTmpPath );
@@ -210,10 +211,11 @@ void test_HYDROData_StricklerTable::test_dump_python()
   aTable->SetName( "ST" );
   CPPUNIT_ASSERT_EQUAL( true, aTable->Import( DEF_STR_PATH ) );
 
-  QString aTmpPath = QDir::tempPath() + "/st_dump.py";
+  QString aTmpPath = TMP_DIR + "/st_dump.py";
+
   CPPUNIT_ASSERT_EQUAL( true, aDoc->DumpToPython( aTmpPath, false ) );
   
-  CPPUNIT_ASSERT_SCRIPTS_EQUAL( "st_dump.py", true, false, 20 );
+  CPPUNIT_ASSERT_SCRIPTS_EQUAL( "st_dump.py", true, true, 0 );
 
   aDoc->Close();
 }