diff options
author | jan Iversen <jani@apache.org> | 2018-08-10 20:59:42 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-13 15:04:50 -0700 |
commit | 80583e63b5ff5c5247df379cb224b3cbd8cce8ab (patch) | |
tree | 777caf4993bc46a890dffccbdffb5a35a615a6cb /tests | |
parent | 859f08a358a10c9299a4bc6eac2802da963a3736 (diff) | |
download | subsurface-80583e63b5ff5c5247df379cb224b3cbd8cce8ab.tar.gz |
tests: move Geocoding test from testpreferences
Remove Geocoding test in testpreferences
add the same Geocoding tests to testqPrefGeocoding
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testpreferences.cpp | 17 | ||||
-rw-r--r-- | tests/testqPrefGeocoding.cpp | 26 | ||||
-rw-r--r-- | tests/testqPrefGeocoding.h | 1 |
3 files changed, 27 insertions, 17 deletions
diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp index 92e0596ef..d5ea72095 100644 --- a/tests/testpreferences.cpp +++ b/tests/testpreferences.cpp @@ -57,23 +57,6 @@ void TestPreferences::testPreferences() TEST(pp->po2ThresholdMin(), 4.0); TEST(pp->po2ThresholdMax(), 5.0); - auto geo = qPrefGeocoding::instance(); - geo->set_first_taxonomy_category(TC_NONE); - geo->set_second_taxonomy_category(TC_OCEAN); - geo->set_third_taxonomy_category(TC_COUNTRY); - - TEST(geo->first_taxonomy_category(), TC_NONE); - TEST(geo->second_taxonomy_category(), TC_OCEAN); - TEST(geo->third_taxonomy_category(), TC_COUNTRY); - - geo->set_first_taxonomy_category(TC_OCEAN); - geo->set_second_taxonomy_category(TC_COUNTRY); - geo->set_third_taxonomy_category(TC_NONE); - - TEST(geo->first_taxonomy_category(), TC_OCEAN); - TEST(geo->second_taxonomy_category(), TC_COUNTRY); - TEST(geo->third_taxonomy_category(), TC_NONE); - auto general = pref->general_settings; general->setDefaultFilename("filename"); general->setDefaultCylinder("cylinder_2"); diff --git a/tests/testqPrefGeocoding.cpp b/tests/testqPrefGeocoding.cpp index b0dbcbc6c..d7c311474 100644 --- a/tests/testqPrefGeocoding.cpp +++ b/tests/testqPrefGeocoding.cpp @@ -101,4 +101,30 @@ void TestQPrefGeocoding::test_multiple() QCOMPARE(tst->second_taxonomy_category(), TC_OCEAN); } +#define TEST(METHOD, VALUE) \ + QCOMPARE(METHOD, VALUE); \ + geo->sync(); \ + geo->load(); \ + QCOMPARE(METHOD, VALUE); + +void TestQPrefGeocoding::test_oldPreferences() +{ + auto geo = qPrefGeocoding::instance(); + geo->set_first_taxonomy_category(TC_NONE); + geo->set_second_taxonomy_category(TC_OCEAN); + geo->set_third_taxonomy_category(TC_COUNTRY); + + TEST(geo->first_taxonomy_category(), TC_NONE); + TEST(geo->second_taxonomy_category(), TC_OCEAN); + TEST(geo->third_taxonomy_category(), TC_COUNTRY); + + geo->set_first_taxonomy_category(TC_OCEAN); + geo->set_second_taxonomy_category(TC_COUNTRY); + geo->set_third_taxonomy_category(TC_NONE); + + TEST(geo->first_taxonomy_category(), TC_OCEAN); + TEST(geo->second_taxonomy_category(), TC_COUNTRY); + TEST(geo->third_taxonomy_category(), TC_NONE); +} + QTEST_MAIN(TestQPrefGeocoding) diff --git a/tests/testqPrefGeocoding.h b/tests/testqPrefGeocoding.h index bfd4605d6..deb02dc67 100644 --- a/tests/testqPrefGeocoding.h +++ b/tests/testqPrefGeocoding.h @@ -14,6 +14,7 @@ private slots: void test_set_load_struct(); void test_struct_disk(); void test_multiple(); + void test_oldPreferences(); }; #endif // TESTQPREFGEOCODING_H |