mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
859f08a358
commit
80583e63b5
3 changed files with 27 additions and 17 deletions
|
@ -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");
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -14,6 +14,7 @@ private slots:
|
|||
void test_set_load_struct();
|
||||
void test_struct_disk();
|
||||
void test_multiple();
|
||||
void test_oldPreferences();
|
||||
};
|
||||
|
||||
#endif // TESTQPREFGEOCODING_H
|
||||
|
|
Loading…
Add table
Reference in a new issue