aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-08 21:25:02 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-10 02:37:03 +0900
commite1cd055111cc4f7e11454b3726741f9f8a55d850 (patch)
treebb391d65743da3285367ec1f1803925978db6877 /tests
parent70cabb968c481e566e8249465f153e05e6dc0347 (diff)
downloadsubsurface-e1cd055111cc4f7e11454b3726741f9f8a55d850.tar.gz
code cleanup: add empty table structures
It seemed to make sense to combine all three types in one commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/testmerge.cpp12
-rw-r--r--tests/testrenumber.cpp12
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/testmerge.cpp b/tests/testmerge.cpp
index 37ab253cc..f57f85429 100644
--- a/tests/testmerge.cpp
+++ b/tests/testmerge.cpp
@@ -21,9 +21,9 @@ void TestMerge::testMergeEmpty()
/*
* check that we correctly merge mixed cylinder dives
*/
- struct dive_table table = { 0 };
- struct trip_table trips = { 0 };
- struct dive_site_table sites = { 0 };
+ struct dive_table table = empty_dive_table;
+ struct trip_table trips = empty_trip_table;
+ struct dive_site_table sites = empty_dive_site_table;
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml", &table, &trips, &sites), 0);
add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test48.xml", &table, &trips, &sites), 0);
@@ -47,9 +47,9 @@ void TestMerge::testMergeBackwards()
/*
* check that we correctly merge mixed cylinder dives
*/
- struct dive_table table = { 0 };
- struct trip_table trips = { 0 };
- struct dive_site_table sites = { 0 };
+ struct dive_table table = empty_dive_table;
+ struct trip_table trips = empty_trip_table;
+ struct dive_site_table sites = empty_dive_site_table;
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test48.xml", &table, &trips, &sites), 0);
add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml", &table, &trips, &sites), 0);
diff --git a/tests/testrenumber.cpp b/tests/testrenumber.cpp
index 9d1289906..53da23f65 100644
--- a/tests/testrenumber.cpp
+++ b/tests/testrenumber.cpp
@@ -13,9 +13,9 @@ void TestRenumber::setup()
void TestRenumber::testMerge()
{
- struct dive_table table = { 0 };
- struct trip_table trips = { 0 };
- struct dive_site_table sites = { 0 };
+ struct dive_table table = empty_dive_table;
+ struct trip_table trips = empty_trip_table;
+ struct dive_site_table sites = empty_dive_site_table;
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47b.xml", &table, &trips, &sites), 0);
add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(dive_table.nr, 1);
@@ -25,9 +25,9 @@ void TestRenumber::testMerge()
void TestRenumber::testMergeAndAppend()
{
- struct dive_table table = { 0 };
- struct trip_table trips = { 0 };
- struct dive_site_table sites = { 0 };
+ struct dive_table table = empty_dive_table;
+ struct trip_table trips = empty_trip_table;
+ struct dive_site_table sites = empty_dive_site_table;
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47c.xml", &table, &trips, &sites), 0);
add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
QCOMPARE(dive_table.nr, 2);