mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
tests: move LocationService test from testpreferences
Remove LocationService test in testpreferences add the same LocationService tests to testqPrefLocationService Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
3174c71563
commit
c97bb239b2
3 changed files with 24 additions and 13 deletions
|
@ -146,19 +146,6 @@ void TestPreferences::testPreferences()
|
||||||
TEST(language->timeFormatOverride(), true);
|
TEST(language->timeFormatOverride(), true);
|
||||||
TEST(language->dateFormatOverride(), true);
|
TEST(language->dateFormatOverride(), true);
|
||||||
TEST(language->useSystemLanguage(), true);
|
TEST(language->useSystemLanguage(), true);
|
||||||
|
|
||||||
auto location = qPrefLocationService::instance();
|
|
||||||
location->set_time_threshold(10);
|
|
||||||
location->set_distance_threshold(20);
|
|
||||||
|
|
||||||
TEST(location->time_threshold(), 10);
|
|
||||||
TEST(location->distance_threshold(), 20);
|
|
||||||
|
|
||||||
location->set_time_threshold(30);
|
|
||||||
location->set_distance_threshold(40);
|
|
||||||
|
|
||||||
TEST(location->timeThreshold(), 30);
|
|
||||||
TEST(location->distanceThreshold(), 40);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QTEST_MAIN(TestPreferences)
|
QTEST_MAIN(TestPreferences)
|
||||||
|
|
|
@ -91,4 +91,27 @@ void TestQPrefLocationService::test_multiple()
|
||||||
QCOMPARE(tst_direct->time_threshold(), 62);
|
QCOMPARE(tst_direct->time_threshold(), 62);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define TEST(METHOD, VALUE) \
|
||||||
|
QCOMPARE(METHOD, VALUE); \
|
||||||
|
location->sync(); \
|
||||||
|
location->load(); \
|
||||||
|
QCOMPARE(METHOD, VALUE);
|
||||||
|
|
||||||
|
void TestQPrefLocationService::test_oldPreferences()
|
||||||
|
{
|
||||||
|
auto location = qPrefLocationService::instance();
|
||||||
|
|
||||||
|
location->set_time_threshold(10);
|
||||||
|
location->set_distance_threshold(20);
|
||||||
|
|
||||||
|
TEST(location->time_threshold(), 10);
|
||||||
|
TEST(location->distance_threshold(), 20);
|
||||||
|
|
||||||
|
location->set_time_threshold(30);
|
||||||
|
location->set_distance_threshold(40);
|
||||||
|
|
||||||
|
TEST(location->time_threshold(), 30);
|
||||||
|
TEST(location->distance_threshold(), 40);
|
||||||
|
}
|
||||||
|
|
||||||
QTEST_MAIN(TestQPrefLocationService)
|
QTEST_MAIN(TestQPrefLocationService)
|
||||||
|
|
|
@ -14,6 +14,7 @@ private slots:
|
||||||
void test_set_load_struct();
|
void test_set_load_struct();
|
||||||
void test_struct_disk();
|
void test_struct_disk();
|
||||||
void test_multiple();
|
void test_multiple();
|
||||||
|
void test_oldPreferences();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TESTQPREFLOCATIONSERVICE_H
|
#endif // TESTQPREFLOCATIONSERVICE_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue