From: Paul RASCLE Date: Sat, 21 May 2016 14:59:02 +0000 (+0200) Subject: more HYDRO_tests corrections X-Git-Tag: v1.6~113^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=517847e04bdabf9ca12e97a68b7a9252df42813d;p=modules%2Fhydro.git more HYDRO_tests corrections --- diff --git a/src/HYDRO_tests/reference_data/st_dump.py b/src/HYDRO_tests/reference_data/st_dump.py index c536a04f..9051a8ef 100644 --- a/src/HYDRO_tests/reference_data/st_dump.py +++ b/src/HYDRO_tests/reference_data/st_dump.py @@ -9,7 +9,7 @@ hydro_doc.SetLocalCS( 0.000, 0.000 ) ST = hydro_doc.CreateObject( KIND_STRICKLER_TABLE ) ST.SetName( "ST" ) -ST.SetAttrName( "CODE_06 " ) +ST.SetAttrName( "CODE_06" ) ST.Set( u"Pelouses et pâturages naturels", 1.0321 ) ST.SetAttrValue( u"Pelouses et pâturages naturels", "321" ) diff --git a/src/HYDRO_tests/reference_data/test.telemac b/src/HYDRO_tests/reference_data/test.telemac index 51506abb..38664213 100644 --- a/src/HYDRO_tests/reference_data/test.telemac +++ b/src/HYDRO_tests/reference_data/test.telemac @@ -6506,10 +6506,10 @@ 5452 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 4673 # faces -0.000 1 2 3 4 5 6 7 -0.000 8 9 10 11 -0.000 12 13 14 -0.000 15 16 17 18 19 20 -0.000 21 22 23 -0.000 24 25 26 27 28 29 30 31 32 33 +1.032 1 2 3 4 5 6 7 +1.032 8 9 10 11 +1.031 12 13 14 +1.031 15 16 17 18 19 20 +1.031 21 22 23 +1.031 24 25 26 27 28 29 30 31 32 33 diff --git a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index d2765253..94b63b91 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -580,17 +580,17 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types() Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); TopoDS_Face aLC1 = Face( QList() << 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, QString::fromUtf8("Zones de champs cultivé à végétation basse")) ); TopoDS_Face aLC2 = Face( QList() << 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, QString::fromUtf8("Zones de champs cultivé à végétation haute")) ); TopoDS_Face aLC3 = Face( QList() << 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, QString::fromUtf8("Zones de champs, prairies, sans cultures")) ); // build presentation object Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap ); @@ -616,17 +616,17 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_coeff() Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); TopoDS_Face aLC1 = Face( QList() << 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, QString::fromUtf8("Zones de champs cultivé à végétation basse")) ); TopoDS_Face aLC2 = Face( QList() << 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, QString::fromUtf8("Zones de champs cultivé à végétation haute")) ); TopoDS_Face aLC3 = Face( QList() << 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, QString::fromUtf8("Zones de champs, prairies, sans cultures")) ); Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap ); aPrs->SetTable( aTable ); @@ -704,8 +704,8 @@ void test_HYDROData_LandCoverMap::test_transparent_prs() Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); - aMap->LocalPartition( Face( QList() << 1 << 1 << 10 << 10 << 10 << 20 ), "Zones de champs cultivé à végétation haute" ); - aMap->LocalPartition( Face( QList() << 5 << 5 << 10 << 5 << 10 << 8 << 5 << 12 << 5 << 8 ), "Zones de champs cultivé à végétation haute" ); + aMap->LocalPartition( Face( QList() << 1 << 1 << 10 << 10 << 10 << 20 ), QString::fromUtf8("Zones de champs cultivé à végétation haute")); + aMap->LocalPartition( Face( QList() << 5 << 5 << 10 << 5 << 10 << 8 << 5 << 12 << 5 << 8 ), QString::fromUtf8("Zones de champs cultivé à végétation haute")); aMap->SetName( "test_LCM" ); TestViewer::show( aZone->GetTopShape(), AIS_Shaded, true, "LandCoverMap_TransparentPrs" ); @@ -1087,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() << 12 << 19 << 82 << 9 << 126 << 53 << 107 << 80 << 29 << 75 ); - CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Forêt et végétation arbustive en mutation" ) ); + CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, QString::fromUtf8("Forêt et végétation arbustive en mutation")) ); TopoDS_Face aLC2 = Face( QList() << 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, "Forêts de conifères" ) ); + CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, QString::fromUtf8("Forêts de conifères")) ); TopoDS_Face aLC3 = Face( QList() << 4 << 54 << 1 << 47 << 51 << 45 << 127 << 42 << 145 << 43 << 148 << 60 << 90 << 65 ); - CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, "Forêts de feuillus" ) ); + CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC3, QString::fromUtf8("Forêts de feuillus")) ); QString aTmpFileName = "test.telemac"; QString aTmpPath = QDir::tempPath() + "/" + aTmpFileName; @@ -1116,10 +1116,10 @@ void test_HYDROData_LandCoverMap::test_copy() aMap->SetName( "map_1" ); TopoDS_Face aLC1 = Face( QList() << 10 << 10 << 30 << 10 << 20 << 20 ); - CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, "Forêts de conifères" ) ); + CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC1, QString::fromUtf8("Forêts de conifères")) ); TopoDS_Face aLC2 = Face( QList() << 110 << 10 << 130 << 10 << 120 << 20 ); - CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, "Forêts de feuillus" ) ); + CPPUNIT_ASSERT_EQUAL( true, aMap->LocalPartition( aLC2, QString::fromUtf8("Forêts de feuillus")) ); Handle(HYDROData_LandCoverMap) aMap2 = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -1128,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( "Forêts de feuillus" ), anIt.StricklerType() ); + CPPUNIT_ASSERT_EQUAL( QString::fromUtf8("Forêts de feuillus"), anIt.StricklerType() ); CPPUNIT_ASSERT( anIt.Face().TShape()!=aLC1.TShape() ); anIt.Next(); CPPUNIT_ASSERT_EQUAL( true, anIt.More() ); - CPPUNIT_ASSERT_EQUAL( QString( "Forêts de conifères" ), anIt.StricklerType() ); + CPPUNIT_ASSERT_EQUAL( QString::fromUtf8("Forêts de conifères"), anIt.StricklerType() ); CPPUNIT_ASSERT( anIt.Face().TShape()!=aLC2.TShape() ); anIt.Next(); CPPUNIT_ASSERT_EQUAL( false, anIt.More() ); diff --git a/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx b/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx index c3248c54..e3c4f4ba 100644 --- a/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx +++ b/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx @@ -43,15 +43,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( QString( "333" ), aTable->GetAttrValue( aType ) ); aDoc->Close(); }