diff options
Diffstat (limited to 'tests/testqPrefLocationService.cpp')
-rw-r--r-- | tests/testqPrefLocationService.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/testqPrefLocationService.cpp b/tests/testqPrefLocationService.cpp index fbd374a4b..0f383212c 100644 --- a/tests/testqPrefLocationService.cpp +++ b/tests/testqPrefLocationService.cpp @@ -6,6 +6,7 @@ #include "core/settings/qPrefLocationService.h" #include <QTest> +#include <QSignalSpy> void TestQPrefLocationService::initTestCase() { @@ -114,4 +115,20 @@ void TestQPrefLocationService::test_oldPreferences() TEST(location->distance_threshold(), 40); } +void TestQPrefLocationService::test_signals() +{ + QSignalSpy spy1(qPrefLocationService::instance(), SIGNAL(distance_thresholdChanged(int))); + QSignalSpy spy2(qPrefLocationService::instance(), SIGNAL(time_thresholdChanged(int))); + + qPrefLocationService::set_distance_threshold(-2000); + qPrefLocationService::set_time_threshold(-90); + + QCOMPARE(spy1.count(), 1); + QCOMPARE(spy2.count(), 1); + + QVERIFY(spy1.takeFirst().at(0).toInt() == -2000); + QVERIFY(spy2.takeFirst().at(0).toInt() == -90); +} + + QTEST_MAIN(TestQPrefLocationService) |