From: isn Date: Wed, 24 Apr 2019 14:06:36 +0000 (+0300) Subject: simple test for DBF info of polylines X-Git-Tag: SH_V2_2_0~99^2~14^2^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=42d1f97b198cf29c1005aec7eaf4220a6d01d78e;p=modules%2Fhydro.git simple test for DBF info of polylines --- diff --git a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx index b7cae3ad..4c0b59c6 100644 --- a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx +++ b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx @@ -660,3 +660,19 @@ void test_HYDROData_PolylineXY::test_import_from_sx_options() CPPUNIT_ASSERT_EQUAL (importedEntities.Size(), 60); } +void test_HYDROData_PolylineXY::test_polyline_dbf_info_simple() +{ + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY)); + QStringList dbf_dummy, dbf_out; + dbf_dummy << "n1" << "n2" << "n3" << "n4"; + aPolyline->SetDBFInfo(dbf_dummy); + CPPUNIT_ASSERT (aPolyline->GetDBFInfo(dbf_out)); + CPPUNIT_ASSERT_EQUAL (dbf_out.size(), 4); + CPPUNIT_ASSERT ("n1" == dbf_out[0]); + CPPUNIT_ASSERT ("n2" == dbf_out[1]); + CPPUNIT_ASSERT ("n3" == dbf_out[2]); + CPPUNIT_ASSERT ("n4" == dbf_out[3]); +} + + diff --git a/src/HYDRO_tests/test_HYDROData_PolylineXY.h b/src/HYDRO_tests/test_HYDROData_PolylineXY.h index 43fd7fbe..fc11cfc0 100644 --- a/src/HYDRO_tests/test_HYDROData_PolylineXY.h +++ b/src/HYDRO_tests/test_HYDROData_PolylineXY.h @@ -33,6 +33,7 @@ class test_HYDROData_PolylineXY : public CppUnit::TestFixture { CPPUNIT_TEST( test_import_from_xyz ); CPPUNIT_TEST( test_import_from_sx ); CPPUNIT_TEST( test_import_from_sx_options ); + CPPUNIT_TEST( test_polyline_dbf_info_simple ); CPPUNIT_TEST_SUITE_END(); private: @@ -61,6 +62,7 @@ public: void test_import_from_xyz(); void test_import_from_sx(); void test_import_from_sx_options(); + void test_polyline_dbf_info_simple(); };