diff options
-rw-r--r-- | tests/testparse.cpp | 57 | ||||
-rw-r--r-- | tests/testparse.h | 2 |
2 files changed, 59 insertions, 0 deletions
diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 49d98f66e..5e6b4cd1a 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -450,5 +450,62 @@ void TestParse::testExport() exportUDDF(); } +void TestParse::parseDL7() +{ + char *params[47]; + int pnr = 0; + + params[pnr++] = strdup("dateField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("datefmt"); + params[pnr++] = intdup(0); + params[pnr++] = strdup("starttimeField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("numberField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("timeField"); + params[pnr++] = intdup(1); + params[pnr++] = strdup("depthField"); + params[pnr++] = intdup(2); + params[pnr++] = strdup("tempField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("po2Field"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("o2sensor1Field"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("o2sensor2Field"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("o2sensor3Field"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("cnsField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("ndlField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("ttsField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("stopdepthField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("pressureField"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("setpointFiend"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("separatorIndex"); + params[pnr++] = intdup(3); + params[pnr++] = strdup("units"); + params[pnr++] = intdup(0); + params[pnr++] = strdup("hw"); + params[pnr++] = strdup("DL7"); + params[pnr++] = 0; + + clear_dive_file_data(); + QCOMPARE(parse_csv_file(SUBSURFACE_TEST_DATA "/dives/DL7.zxu", + params, pnr - 1 , "DL7"), 0); + QCOMPARE(dive_table.nr, 1); + + FILE_COMPARE("testuddfexport.uddf", + "testuddfexport2.uddf"); + clear_dive_file_data(); +} + QTEST_GUILESS_MAIN(TestParse) diff --git a/tests/testparse.h b/tests/testparse.h index 937902b18..dc2065560 100644 --- a/tests/testparse.h +++ b/tests/testparse.h @@ -32,6 +32,8 @@ private slots: void exportUDDF(); void testExport(); + void parseDL7(); + private: sqlite3 *_sqlite3_handle = NULL; }; |