From 0160e58e7d36615ad60b76277d7679a781cfed55 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 13 Sep 2015 21:30:25 +0300 Subject: Test case: reading zip and DLD parsing Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- tests/testparse.cpp | 12 ++++++++++++ tests/testparse.h | 1 + 2 files changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 7d892fab4..3490ad8cb 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -357,4 +357,16 @@ void TestParse::testParseCompareNewFormatOutput() clear_dive_file_data(); } +void TestParse::testParseDLD() +{ + struct memblock mem; + int ret, success = 0; + QString filename = SUBSURFACE_SOURCE "/dives/TestDiveDivelogsDE.DLD"; + + QVERIFY(readfile(filename.toLatin1().data(), &mem) > 0); + QVERIFY(try_to_open_zip(filename.toLatin1().data(), &mem) > 0); + + fprintf(stderr, "number of dives from DLD: %d \n", dive_table.nr); +} + QTEST_MAIN(TestParse) diff --git a/tests/testparse.h b/tests/testparse.h index 53cc07afb..147c0e13a 100644 --- a/tests/testparse.h +++ b/tests/testparse.h @@ -17,6 +17,7 @@ private slots: void testParseCompareHUDCOutput(); void testParseNewFormat(); void testParseCompareNewFormatOutput(); + void testParseDLD(); }; #endif -- cgit v1.2.3-70-g09d2