summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-09 22:16:08 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-09 22:22:12 -0800
commitec20d36f3c895abfb68320176e8b23b9b90b6e2c (patch)
tree815bee3e6c9286eb8af064d2af98ce221ccc17c9 /tests
parente8923a9badd1072b9a7905e23ef5f570ad48b5a1 (diff)
downloadsubsurface-ec20d36f3c895abfb68320176e8b23b9b90b6e2c.tar.gz
Add test for merging multiple cylinders
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/testparse.cpp22
-rw-r--r--tests/testparse.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/testparse.cpp b/tests/testparse.cpp
index 223b4469b..b0baab403 100644
--- a/tests/testparse.cpp
+++ b/tests/testparse.cpp
@@ -419,4 +419,26 @@ void TestParse::testParseCompareDLDOutput()
clear_dive_file_data();
}
+void TestParse::testParseMerge()
+{
+ /*
+ * check that we correctly merge mixed cylinder dives
+ */
+ QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/ostc.xml"), 0);
+ QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/vyper.xml"), 0);
+ QCOMPARE(save_dives("./testmerge.ssrf"), 0);
+ QFile org(SUBSURFACE_SOURCE "/dives/mergedVyperOstc.xml");
+ org.open(QFile::ReadOnly);
+ QFile out("./testmerge.ssrf");
+ out.open(QFile::ReadOnly);
+ QTextStream orgS(&org);
+ QTextStream outS(&out);
+ QStringList readin = orgS.readAll().split("\n");
+ QStringList written = outS.readAll().split("\n");
+ while(readin.size() && written.size()){
+ QCOMPARE(readin.takeFirst(), written.takeFirst());
+ }
+ clear_dive_file_data();
+}
+
QTEST_GUILESS_MAIN(TestParse)
diff --git a/tests/testparse.h b/tests/testparse.h
index d99f9e53e..c11420794 100644
--- a/tests/testparse.h
+++ b/tests/testparse.h
@@ -20,6 +20,7 @@ private slots:
void testParseCompareNewFormatOutput();
void testParseDLD();
void testParseCompareDLDOutput();
+ void testParseMerge();
};
#endif