From: asl Date: Fri, 13 Nov 2015 10:58:07 +0000 (+0300) Subject: refs #673: test for export to Telemac X-Git-Tag: v1.5~43^2~3^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ed212e770c6b27f801c094fc3774fb1f4d021b27;p=modules%2Fhydro.git refs #673: test for export to Telemac --- diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index fd031b6d..d6d14bd5 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -284,7 +284,21 @@ void TestViewer::select( int theViewX, int theViewY ) context()->Select(); } -bool TestViewer::areScriptsEqual( const QString& theBaseName ) +QString GetLine( QFile& theFile, bool isUtf8 ) +{ + QByteArray aLineData = theFile.readLine(); + QString aLine; + if( isUtf8 ) + aLine = QString::fromUtf8( aLineData ); + else + aLine = aLineData; + return aLine; +} + +bool TestViewer::areScriptsEqual( const QString& theBaseName, + bool isExpectedUtf8, + bool isActualUtf8, + int theLinesToOmit ) { QString anExpectedRefFilePath = qgetenv( "HYDRO_REFERENCE_DATA" ); anExpectedRefFilePath += "/" + theBaseName; @@ -297,15 +311,14 @@ bool TestViewer::areScriptsEqual( const QString& theBaseName ) !anActual.open ( QFile::ReadOnly | QFile::Text ) ) return false; - const int aLinesToOmit = 20; - for( int i=0; iExportTelemac( aTmpPath, 1E-4 ) ); - CPPUNIT_ASSERT_SCRIPTS_EQUAL( aTmpFileName ); + CPPUNIT_ASSERT_SCRIPTS_EQUAL( aTmpFileName, true, true, 0 ); aDoc->Close(); } diff --git a/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx b/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx index 3c013483..184360d3 100644 --- a/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx +++ b/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx @@ -211,7 +211,7 @@ void test_HYDROData_StricklerTable::test_dump_python() QString aTmpPath = QDir::tempPath() + "/st_dump.py"; CPPUNIT_ASSERT_EQUAL( true, aDoc->DumpToPython( aTmpPath, false ) ); - CPPUNIT_ASSERT_SCRIPTS_EQUAL( "st_dump.py" ); + CPPUNIT_ASSERT_SCRIPTS_EQUAL( "st_dump.py", true, false, 20 ); aDoc->Close(); }