mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
1153f81856
commit
1e8ea9061e
2 changed files with 22 additions and 0 deletions
|
@ -369,4 +369,25 @@ void TestParse::testParseDLD()
|
||||||
fprintf(stderr, "number of dives from DLD: %d \n", dive_table.nr);
|
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)
|
QTEST_MAIN(TestParse)
|
||||||
|
|
|
@ -18,6 +18,7 @@ private slots:
|
||||||
void testParseNewFormat();
|
void testParseNewFormat();
|
||||||
void testParseCompareNewFormatOutput();
|
void testParseCompareNewFormatOutput();
|
||||||
void testParseDLD();
|
void testParseDLD();
|
||||||
|
void testParseCompareDLDOutput();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue