aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-17 16:07:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-24 09:51:37 -0700
commit39a4090c0a6e1d8fe12516be06ee7b31dd4bc96d (patch)
tree7587930b64bf95ec3a652cf761e6ded573931364 /tests
parentfadea413cdb4644b821369b27fad6e5f019d32c2 (diff)
downloadsubsurface-39a4090c0a6e1d8fe12516be06ee7b31dd4bc96d.tar.gz
devices: add devices in Command::importTable()
Add a device_table parameters to Command::importTable() and add_imported_dives(). The content of this table will be added to the global device list (respectively removed on undo). This is currently a no-op, as the parser doesn't yet fill out the device table, but adds devices directly to the global device table. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/testmerge.cpp8
-rw-r--r--tests/testrenumber.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/testmerge.cpp b/tests/testmerge.cpp
index b71bb0955..e710de66e 100644
--- a/tests/testmerge.cpp
+++ b/tests/testmerge.cpp
@@ -29,9 +29,9 @@ void TestMerge::testMergeEmpty()
struct device_table devices;
struct filter_preset_table filter_presets;
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml", &table, &trips, &sites, &devices, &filter_presets), 0);
- add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
+ add_imported_dives(&table, &trips, &sites, &devices, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test48.xml", &table, &trips, &sites, &devices, &filter_presets), 0);
- add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
+ add_imported_dives(&table, &trips, &sites, &devices, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(save_dives("./testmerge47+48.ssrf"), 0);
QFile org(SUBSURFACE_TEST_DATA "/dives/test47+48.xml");
org.open(QFile::ReadOnly);
@@ -57,9 +57,9 @@ void TestMerge::testMergeBackwards()
struct device_table devices;
struct filter_preset_table filter_presets;
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test48.xml", &table, &trips, &sites, &devices, &filter_presets), 0);
- add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
+ add_imported_dives(&table, &trips, &sites, &devices, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml", &table, &trips, &sites, &devices, &filter_presets), 0);
- add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
+ add_imported_dives(&table, &trips, &sites, &devices, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(save_dives("./testmerge47+48.ssrf"), 0);
QFile org(SUBSURFACE_TEST_DATA "/dives/test48+47.xml");
org.open(QFile::ReadOnly);
diff --git a/tests/testrenumber.cpp b/tests/testrenumber.cpp
index af5bd0203..69ab15b22 100644
--- a/tests/testrenumber.cpp
+++ b/tests/testrenumber.cpp
@@ -21,7 +21,7 @@ void TestRenumber::testMerge()
struct device_table devices;
struct filter_preset_table filter_presets;
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47b.xml", &table, &trips, &sites, &devices, &filter_presets), 0);
- add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
+ add_imported_dives(&table, &trips, &sites, &devices, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(dive_table.nr, 1);
QCOMPARE(unsaved_changes(), 1);
mark_divelist_changed(false);
@@ -35,7 +35,7 @@ void TestRenumber::testMergeAndAppend()
struct device_table devices;
struct filter_preset_table filter_presets;
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47c.xml", &table, &trips, &sites, &devices, &filter_presets), 0);
- add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
+ add_imported_dives(&table, &trips, &sites, &devices, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(dive_table.nr, 2);
QCOMPARE(unsaved_changes(), 1);
struct dive *d = get_dive(1);