From d9443cd8cdb58cafd4bfb436bac8b1be8a049377 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 9 Dec 2016 12:22:59 +0300 Subject: [PATCH] automatic test for DTM, refs issue #1066 --- src/HYDRO_tests/reference_data/CMakeLists.txt | 1 + src/HYDRO_tests/reference_data/pb_1066.cbf | Bin 0 -> 16636 bytes src/HYDRO_tests/test_HYDROData_DTM.cxx | 26 ++++++++++++++++++ src/HYDRO_tests/test_HYDROData_DTM.h | 2 ++ 4 files changed, 29 insertions(+) create mode 100644 src/HYDRO_tests/reference_data/pb_1066.cbf diff --git a/src/HYDRO_tests/reference_data/CMakeLists.txt b/src/HYDRO_tests/reference_data/CMakeLists.txt index b3fb1124..2ee55128 100644 --- a/src/HYDRO_tests/reference_data/CMakeLists.txt +++ b/src/HYDRO_tests/reference_data/CMakeLists.txt @@ -116,6 +116,7 @@ SET(REFERENCE_DATA DTM_2.png stream_dtm_2d.png stream_dtm_3d.png + pb_1066.cbf ) # Application tests diff --git a/src/HYDRO_tests/reference_data/pb_1066.cbf b/src/HYDRO_tests/reference_data/pb_1066.cbf new file mode 100644 index 0000000000000000000000000000000000000000..220d577f1e3d151087cb195be13b2c198d9f5bf6 GIT binary patch literal 16636 zcmdU04|r77m47b=&?pEfZI$gZh@wWQnS=z0!c0ge5Fmd{1{9&>nN5YpeV9k6)&Uwv@;pzg8CN7OL%(*so@qrPZpCJ->I~dGF1g z_vlc8e!Xz>-rRfcz30#GoO|ZII}0kR$}5)o)T~Rg$0&-DlO^gnx{jQspkF0=)Y&=o z$DMy`Ug53zdF~?mpf$U3!{sWvxtc20sxPmutt{~uyB37P)s2B>wAcE|eYL)-QeS;( z^|C6zueR8g_i<{ktS+l4uP80?S5#M-UGB@NtIl6i>#z5(sPWZ}r;q-!KrB!fYpSmZ z$AT@v=vZr8RiHgMQEq6$2(6X6L*bTsP&L)H20DV1thD-sCDCZ0N6cDY?+>)pMY^Jm z!H-!fYlF?fXfWIuTpH?(O-Sttw4pJD+}9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4Vkc1<`Ki&v)C(R(VMAHjWJnwcFM8n%`vYEvL>8h6vnhA}&+VT*{geJ^{EhHb<;6uI?;<^a z?bY*FgH2X~iKi4D$$_#@pQ;sb%{0wP~*kV{bWpP#|Yl*j^ls!uBlvO8h u2FBv7L35AdU0h|wsfH?<742s+n!HBL<8r literal 0 HcmV?d00001 diff --git a/src/HYDRO_tests/test_HYDROData_DTM.cxx b/src/HYDRO_tests/test_HYDROData_DTM.cxx index 3cf271fd..c9934653 100644 --- a/src/HYDRO_tests/test_HYDROData_DTM.cxx +++ b/src/HYDRO_tests/test_HYDROData_DTM.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -620,5 +621,30 @@ void test_HYDROData_DTM::test_garonne() TestViewer::showColorScale( ColorScaleIsDisp ); delete aBathPrs; aDoc->Close(); +} +void test_HYDROData_DTM::test_classifier_1() +{ + TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); + fname += "/pb_1066.cbf"; + CPPUNIT_ASSERT_EQUAL( DocError_OK, HYDROData_Document::Load( fname.ToCString(), 1 ) ); + + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + + Handle(HYDROData_CalculationCase) aCase = + Handle(HYDROData_CalculationCase)::DownCast( aDoc->FindObjectByName( "Case_1" ) ); + CPPUNIT_ASSERT_EQUAL( Standard_False, aCase.IsNull() ); + std::vector points; + points.push_back( gp_XY( 43.4842, 3.33176 ) ); + points.push_back( gp_XY( -125.777, 2.24728 ) ); + points.push_back( gp_XY( -60.1628, 168.262 ) ); + + std::vector values = aCase->GetStricklerCoefficientForPoints( points, 0.0, true ); + CPPUNIT_ASSERT_EQUAL( 3, (int)values.size() ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0123, values[0], EPS ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0123, values[1], EPS ); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0221, values[2], EPS ); + + aDoc->Close(); } + diff --git a/src/HYDRO_tests/test_HYDROData_DTM.h b/src/HYDRO_tests/test_HYDROData_DTM.h index 5eb53be1..57413786 100644 --- a/src/HYDRO_tests/test_HYDROData_DTM.h +++ b/src/HYDRO_tests/test_HYDROData_DTM.h @@ -31,6 +31,7 @@ class test_HYDROData_DTM : public CppUnit::TestFixture CPPUNIT_TEST( test_curve_to_3d ); CPPUNIT_TEST( test_presentation ); CPPUNIT_TEST( test_garonne ); + CPPUNIT_TEST( test_classifier_1 ); CPPUNIT_TEST_SUITE_END(); public: @@ -47,6 +48,7 @@ public: void test_curve_to_3d(); void test_presentation(); void test_garonne(); + void test_classifier_1(); }; CPPUNIT_TEST_SUITE_REGISTRATION( test_HYDROData_DTM ); -- 2.39.2