]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
simple test for DBF info of polylines
authorisn <isn@opencascade.com>
Wed, 24 Apr 2019 14:06:36 +0000 (17:06 +0300)
committerisn <isn@opencascade.com>
Wed, 24 Apr 2019 14:06:36 +0000 (17:06 +0300)
src/HYDRO_tests/test_HYDROData_PolylineXY.cxx
src/HYDRO_tests/test_HYDROData_PolylineXY.h

index b7cae3ade2c55855c24313affd6c125e45d5ed83..4c0b59c6591c5555e97c7b2a8ad5900cdd5171bb 100644 (file)
@@ -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]);
+}
+
+
index 43fd7fbef2eea123d0533571fd4e794e9346aef0..fc11cfc0e182bb4f23fd6b6234e1967ab85f7e2d 100644 (file)
@@ -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();
 
 };