]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
additional tests BR_DBF_SUPPORT
authorisn <isn@opencascade.com>
Fri, 16 Oct 2015 19:09:08 +0000 (22:09 +0300)
committerisn <isn@opencascade.com>
Fri, 16 Oct 2015 19:09:08 +0000 (22:09 +0300)
src/HYDRO_tests/reference_data/ref_dbf2.dbf [new file with mode: 0644]
src/HYDRO_tests/reference_data/ref_dbf3.dbf [new file with mode: 0644]
src/HYDRO_tests/test_HYDROData_ShapeFile.cxx

diff --git a/src/HYDRO_tests/reference_data/ref_dbf2.dbf b/src/HYDRO_tests/reference_data/ref_dbf2.dbf
new file mode 100644 (file)
index 0000000..123bc06
Binary files /dev/null and b/src/HYDRO_tests/reference_data/ref_dbf2.dbf differ
diff --git a/src/HYDRO_tests/reference_data/ref_dbf3.dbf b/src/HYDRO_tests/reference_data/ref_dbf3.dbf
new file mode 100644 (file)
index 0000000..109e16f
Binary files /dev/null and b/src/HYDRO_tests/reference_data/ref_dbf3.dbf differ
index e0369578ef897484ed4439ba8ce1bec0f607c839..9df6c81365691cde75242c39c40a42f5fadf9b85 100644 (file)
@@ -217,5 +217,27 @@ void test_HYDROData_ShapeFile::test_DbfWrite()
     CPPUNIT_ASSERT_EQUAL( 0, remove (tempFN.toStdString().c_str()));
   }
 
+  {
+    HYDROData_ShapeFile aSHPFile; 
+    QString tempFN = REF_PATH + "/temp_dbf3.dbf";
+    QString refFN = REF_PATH + "/ref_dbf3.dbf";
+    std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
+    HYDROData_ShapeFile::DBF_AttrValue theAttr1;
+    theAttr1.myFieldType = HYDROData_ShapeFile::DBF_FieldType_Integer;
+    theAttr1.myIsNull = false;
+
+    for (int ii = 0; ii < 100; ii++)
+    {
+      theAttr1.myIntVal = ii;
+      theAttrV.push_back(theAttr1);
+    }
+
+    //
+    CPPUNIT_ASSERT(aSHPFile.DBF_WriteFieldAndValues(tempFN, "test_field_name", HYDROData_ShapeFile::DBF_FieldType_Integer, theAttrV, false));
+
+    CPPUNIT_ASSERT(compare_two_files(tempFN, refFN));
+    CPPUNIT_ASSERT_EQUAL( 0, remove (tempFN.toStdString().c_str()));
+  }
+
 }