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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
CCR dive
diff --git a/tests/testparse.cpp b/tests/testparse.cpp
index 7b6efa104..2bedc88bd 100644
--- a/tests/testparse.cpp
+++ b/tests/testparse.cpp
@@ -1,5 +1,6 @@
#include "testparse.h"
#include "dive.h"
+#include "file.h"
#include
void TestParse::testParseCSV()
@@ -18,6 +19,20 @@ void TestParse::testParseCSV()
fprintf(stderr, "number of dives %d \n", dive_table.nr);
}
+void TestParse::testParseDivingLog()
+{
+ // Parsing of DivingLog import from SQLite database
+ sqlite3 *handle;
+
+ struct dive_site *ds = alloc_dive_site(0xdeadbeef);
+ ds->name = copy_string("Suomi - - Hälvälä");
+
+ QCOMPARE(sqlite3_open(SUBSURFACE_SOURCE "/dives/TestDivingLog4.1.1.sql", &handle), 0);
+ QCOMPARE(parse_divinglog_buffer(handle, 0, 0, 0, &dive_table), 0);
+
+ sqlite3_close(handle);
+}
+
void TestParse::testParseV2NoQuestion()
{
// parsing of a V2 file should work
diff --git a/tests/testparse.h b/tests/testparse.h
index 2e24ec844..5e1dc03d2 100644
--- a/tests/testparse.h
+++ b/tests/testparse.h
@@ -7,6 +7,7 @@ class TestParse : public QObject{
Q_OBJECT
private slots:
void testParseCSV();
+ void testParseDivingLog();
void testParseV2NoQuestion();
void testParseV3();
void testParseCompareOutput();