Salome HOME
Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into...
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_Bathymetry.cxx
index 45a8e2563fcec7fce8dd0f0101201ec2b181e01b..a4ccd3425cee6c40370bc7189db1da0890fa9947 100644 (file)
@@ -45,7 +45,7 @@ void generateOne( QTextStream& theStream,
   {
     double anX = theFirstX * (1-t) + theLastX * t;
     double anY = theFirstY * (1-t) + theLastY * t;
-    double aZ = aStepZ * aStepZ + sin( (float)rand() );
+    double aZ = aStepZ * aStepZ + sin( 10*t );
     theStream << anX << " " << anY << " " << aZ << " \n";
 
     aStepZ += 0.2;
@@ -61,7 +61,6 @@ bool test_HYDROData_Bathymetry::createTestFile( const QString& theFileName )
   {
     QTextStream anOutStream( &aTmpFile );
 
-    srand( 4587 );
     generateOne( anOutStream, 0, 5, 0, -5 );
     generateOne( anOutStream, 10, 5, 10, -5 );
     generateOne( anOutStream, 20, 5, 20, -5 );
@@ -133,27 +132,27 @@ void test_HYDROData_Bathymetry::testFileImport()
 
   gp_XY aTestPoint( 1, 1 );
   double anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint );
-  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.9755, anAltitude, EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.2432, anAltitude, EPS );
 
   aTestPoint = gp_XY( 0.5, 0.5 );
   anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint );
-  CPPUNIT_ASSERT_DOUBLES_EQUAL(  0.0147, anAltitude, EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL( -0.3816, anAltitude, EPS );
 
   aTestPoint = gp_XY( 1.5, 1 );
   anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint );
-  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.9534, anAltitude, EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.2432, anAltitude, EPS );
 
   aTestPoint = gp_XY( 1.5, 0.7 );
   anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint );
-  CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.5032, anAltitude, EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL(  -0.1608, anAltitude, EPS );
 
   aTestPoint = gp_XY( 1.5, -0.7 );
   anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint );
-  CPPUNIT_ASSERT_DOUBLES_EQUAL( 6.3088, anAltitude, EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL( 5.0093, anAltitude, EPS );
 
   aTestPoint = gp_XY( 2, 3.5 );
   anAltitude = aBathymetry->GetAltitudeForPoint( aTestPoint );
-  CPPUNIT_ASSERT_DOUBLES_EQUAL( 11.090, anAltitude, EPS );
+  CPPUNIT_ASSERT_DOUBLES_EQUAL( 12.6829, anAltitude, EPS );
 
   aDoc->Close();
 }