From 6780df21a603b374c850fc560d6d4855341d45c3 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sun, 15 May 2016 16:31:17 +0200 Subject: [PATCH] HYDRO_tests errors correction --- src/HYDRO_tests/TestViewer.cxx | 4 ++-- src/HYDRO_tests/test_HYDROData_Bathymetry.cxx | 20 +++++++++---------- src/HYDRO_tests/test_HYDROData_Main.cxx | 2 +- src/HYDRO_tests/test_HYDROData_ShapeFile.cxx | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 52917a31..d3e997c6 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -242,7 +242,7 @@ bool TestViewer::AssertImages( QString& theMessage ) { QImage anActualImage = viewWindow()->dumpView(); - QString anExpectedRefFilePath = qgetenv( "HYDRO_REFERENCE_DATA" ); + QString anExpectedRefFilePath = qgetenv( "HYDRO_DIR" ) + "/../../src/HYDRO/src/HYDRO_tests/reference_data"; anExpectedRefFilePath += "/" + myKey + ".png"; QImage anExpectedRefImage; anExpectedRefImage.load( anExpectedRefFilePath ); @@ -342,7 +342,7 @@ bool TestViewer::areScriptsEqual( const QString& theBaseName, int theLinesToOmit, QString& theMsg ) { - QString anExpectedRefFilePath = qgetenv( "HYDRO_REFERENCE_DATA" ); + QString anExpectedRefFilePath = qgetenv( "HYDRO_DIR" ) + "/../../src/HYDRO/src/HYDRO_tests/reference_data"; anExpectedRefFilePath += "/" + theBaseName; QString anActualFilePath = QDir::tempPath() + "/" + theBaseName; diff --git a/src/HYDRO_tests/test_HYDROData_Bathymetry.cxx b/src/HYDRO_tests/test_HYDROData_Bathymetry.cxx index a4ccd342..4a25258f 100644 --- a/src/HYDRO_tests/test_HYDROData_Bathymetry.cxx +++ b/src/HYDRO_tests/test_HYDROData_Bathymetry.cxx @@ -131,28 +131,28 @@ void test_HYDROData_Bathymetry::testFileImport() CPPUNIT_ASSERT_EQUAL( 2300, anAltitudePoints.Length() ); gp_XY aTestPoint( 1, 1 ); - double anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint ); + double anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint, 1 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.2432, anAltitude, EPS ); aTestPoint = gp_XY( 0.5, 0.5 ); - anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint ); - CPPUNIT_ASSERT_DOUBLES_EQUAL( -0.3816, anAltitude, EPS ); + anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint, 1 ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( -0.7127, anAltitude, EPS ); aTestPoint = gp_XY( 1.5, 1 ); - anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint ); + anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint, 1 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.2432, anAltitude, EPS ); aTestPoint = gp_XY( 1.5, 0.7 ); - anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint ); - CPPUNIT_ASSERT_DOUBLES_EQUAL( -0.1608, anAltitude, EPS ); + anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint, 1 ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( -0.4116, anAltitude, EPS ); aTestPoint = gp_XY( 1.5, -0.7 ); - anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint ); - CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0093, anAltitude, EPS ); + anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint, 1 ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( -0.0479, anAltitude, EPS ); aTestPoint = gp_XY( 2, 3.5 ); - anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint ); - CPPUNIT_ASSERT_DOUBLES_EQUAL( 12.6829, anAltitude, EPS ); + anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint, 1 ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 13.2525, anAltitude, EPS ); aDoc->Close(); } diff --git a/src/HYDRO_tests/test_HYDROData_Main.cxx b/src/HYDRO_tests/test_HYDROData_Main.cxx index c4e3239e..7382740c 100644 --- a/src/HYDRO_tests/test_HYDROData_Main.cxx +++ b/src/HYDRO_tests/test_HYDROData_Main.cxx @@ -53,7 +53,7 @@ int main( int argc, char* argv[] ) // Create the event manager and test controller CppUnit::TestResult controller; - // Add a listener that colllects test result + // Add a listener that collects test result CppUnit::TestResultCollector result; controller.addListener( &result ); diff --git a/src/HYDRO_tests/test_HYDROData_ShapeFile.cxx b/src/HYDRO_tests/test_HYDROData_ShapeFile.cxx index 9df6c813..e9a878df 100644 --- a/src/HYDRO_tests/test_HYDROData_ShapeFile.cxx +++ b/src/HYDRO_tests/test_HYDROData_ShapeFile.cxx @@ -21,7 +21,7 @@ #include #include -const QString REF_PATH = qgetenv( "HYDRO_REFERENCE_DATA" ); +const QString REF_PATH = qgetenv( "HYDRO_DIR" ) + "/../../src/HYDRO/src/HYDRO_tests/reference_data"; bool test_HYDROData_ShapeFile::compare_two_files(const QString& File1, const QString& File2) { -- 2.39.2