From 1e8ea9061ec71e65e7521fd2a8714dd092b1cf7e Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 13 Sep 2015 21:30:27 +0300 Subject: Test case: compare DLD log with a saved one Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- tests/testparse.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/testparse.cpp') 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) -- cgit v1.2.3-70-g09d2