From 858d3e2eed188b609090b20ecaba2f779aedb6eb Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 5 Apr 2019 21:56:20 +0200 Subject: Dive site: fix merging tests The handling of dive site merging changed and therefore the tests have to be adapted. 1) Dive sites are recognized as identical based on their name. Therefore, give the dive sites that should be merged the same name. 2) The dive site id of the first imported dive is kept. Thus, merge and reverse merge produce two different output files. Create a second file reflecting that fact. Signed-off-by: Berthold Stoeger --- dives/test48+47.xml | 22 ++++++++++++++++++++++ dives/test48.xml | 2 +- tests/testmerge.cpp | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 dives/test48+47.xml diff --git a/dives/test48+47.xml b/dives/test48+47.xml new file mode 100644 index 000000000..862d4765e --- /dev/null +++ b/dives/test48+47.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/dives/test48.xml b/dives/test48.xml index 421325c4b..0fec5c619 100644 --- a/dives/test48.xml +++ b/dives/test48.xml @@ -1,6 +1,6 @@ - + diff --git a/tests/testmerge.cpp b/tests/testmerge.cpp index 739e7014d..bef03cb14 100644 --- a/tests/testmerge.cpp +++ b/tests/testmerge.cpp @@ -55,7 +55,7 @@ void TestMerge::testMergeBackwards() QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml", &table, &trips, &sites), 0); add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS); QCOMPARE(save_dives("./testmerge47+48.ssrf"), 0); - QFile org(SUBSURFACE_TEST_DATA "/dives/test47+48.xml"); + QFile org(SUBSURFACE_TEST_DATA "/dives/test48+47.xml"); org.open(QFile::ReadOnly); QFile out("./testmerge47+48.ssrf"); out.open(QFile::ReadOnly); -- cgit v1.2.3-70-g09d2