diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2016-10-15 19:21:44 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-10-15 12:21:32 -0700 |
commit | 256d16a54067f9e4143ec9491de5abd56dbd1a4d (patch) | |
tree | 38d55af64da5bba002bd71e82d666beae5b9d10a | |
parent | 4fcf7928f87598b9dc40084d2b6dc2e2c4a69dac (diff) | |
download | subsurface-256d16a54067f9e4143ec9491de5abd56dbd1a4d.tar.gz |
Test geologation
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.h | 6 | ||||
-rw-r--r-- | tests/testpreferences.cpp | 33 |
2 files changed, 36 insertions, 3 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h index 8097fc3c9..8fd164f89 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.h +++ b/core/subsurface-qt/SettingsObjectWrapper.h @@ -268,9 +268,9 @@ public slots: void setEnableGeocoding(bool value); void setParseDiveWithoutGps(bool value); void setTagExistingDives(bool value); - void setFirstTaxonomyCategory(taxonomy_category value); - void setSecondTaxonomyCategory(taxonomy_category value); - void setThirdTaxonomyCategory(taxonomy_category value); + void setFirstTaxonomyCategory(taxonomy_category value); + void setSecondTaxonomyCategory(taxonomy_category value); + void setThirdTaxonomyCategory(taxonomy_category value); signals: void enableGeocodingChanged(bool value); diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp index e9ea71936..9f668896d 100644 --- a/tests/testpreferences.cpp +++ b/tests/testpreferences.cpp @@ -247,6 +247,39 @@ void TestPreferences::testPreferences() TEST(fb->accessToken(),QStringLiteral("rand-access-token-2")); TEST(fb->userId(), QStringLiteral("tomaz-user-id-2")); TEST(fb->albumId(), QStringLiteral("album-id-2")); + + auto geo = pref->geocoding; + geo->setEnableGeocoding(true); + geo->setParseDiveWithoutGps(true); + geo->setTagExistingDives(true); + + TEST(geo->enableGeocoding(),true); + TEST(geo->parseDiveWithoutGps(),true); + TEST(geo->tagExistingDives(),true); + + geo->setFirstTaxonomyCategory(TC_NONE); + geo->setSecondTaxonomyCategory(TC_OCEAN); + geo->setThirdTaxonomyCategory(TC_COUNTRY); + + TEST(geo->firstTaxonomyCategory(), TC_NONE); + TEST(geo->secondTaxonomyCategory(), TC_OCEAN); + TEST(geo->thirdTaxonomyCategory(), TC_COUNTRY); + + geo->setEnableGeocoding(false); + geo->setParseDiveWithoutGps(false); + geo->setTagExistingDives(false); + + TEST(geo->enableGeocoding(),false); + TEST(geo->parseDiveWithoutGps(),false); + TEST(geo->tagExistingDives(),false); + + geo->setFirstTaxonomyCategory(TC_OCEAN); + geo->setSecondTaxonomyCategory(TC_COUNTRY); + geo->setThirdTaxonomyCategory(TC_NONE); + + TEST(geo->firstTaxonomyCategory(), TC_OCEAN); + TEST(geo->secondTaxonomyCategory(), TC_COUNTRY); + TEST(geo->thirdTaxonomyCategory(), TC_NONE); } QTEST_MAIN(TestPreferences) |