diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-09-13 21:30:27 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-13 15:28:04 -0700 |
commit | 1e8ea9061ec71e65e7521fd2a8714dd092b1cf7e (patch) | |
tree | c1d1cf7173522e4508dcf35e5060b1a083d1849c /tests | |
parent | 1153f81856990afa5a4de7b5a99a4abaab2d44cc (diff) | |
download | subsurface-1e8ea9061ec71e65e7521fd2a8714dd092b1cf7e.tar.gz |
Test case: compare DLD log with a saved one
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testparse.cpp | 21 | ||||
-rw-r--r-- | tests/testparse.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 3490ad8cb..1a4c0eac5 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -369,4 +369,25 @@ void TestParse::testParseDLD() fprintf(stderr, "number of dives from DLD: %d \n", dive_table.nr); } +void TestParse::testParseCompareDLDOutput() +{ + /* + * DC is not cleared from previous tests with the + * clear_dive_file_data(), so we do have an additional DC nick + * name field on the log. + */ + + QCOMPARE(save_dives("./testdldout.ssrf"), 0); + QFile org(SUBSURFACE_SOURCE "/dives/TestDiveDivelogsDE.xml"); + org.open(QFile::ReadOnly); + QFile out("./testdldout.ssrf"); + out.open(QFile::ReadOnly); + QTextStream orgS(&org); + QTextStream outS(&out); + QString readin = orgS.readAll(); + QString written = outS.readAll(); + QCOMPARE(readin, written); + clear_dive_file_data(); +} + QTEST_MAIN(TestParse) diff --git a/tests/testparse.h b/tests/testparse.h index 147c0e13a..5616f0718 100644 --- a/tests/testparse.h +++ b/tests/testparse.h @@ -18,6 +18,7 @@ private slots: void testParseNewFormat(); void testParseCompareNewFormatOutput(); void testParseDLD(); + void testParseCompareDLDOutput(); }; #endif |