2018-08-06 16:45:32 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
import QtQuick 2.6
|
|
|
|
import QtTest 1.2
|
|
|
|
|
|
|
|
TestCase {
|
|
|
|
name: "qPrefLocationService"
|
|
|
|
|
|
|
|
function test_variables() {
|
2018-09-07 11:53:00 +00:00
|
|
|
var x1 = PrefLocationService.distance_threshold
|
|
|
|
PrefLocationService.distance_threshold = 123
|
|
|
|
compare(PrefLocationService.distance_threshold , 123)
|
2018-08-06 16:45:32 +00:00
|
|
|
|
2018-09-07 11:53:00 +00:00
|
|
|
var x2 = PrefLocationService.time_threshold
|
|
|
|
PrefLocationService.time_threshold = 12
|
|
|
|
compare(PrefLocationService.time_threshold , 12)
|
2018-08-06 16:45:32 +00:00
|
|
|
}
|
2018-08-28 10:33:47 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: spyCatcher
|
|
|
|
|
|
|
|
property bool spy1 : false
|
|
|
|
property bool spy2 : false
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: PrefLocationService
|
|
|
|
onDistance_thresholdChanged: {spyCatcher.spy1 = true }
|
|
|
|
onTime_thresholdChanged: {spyCatcher.spy2 = true }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_signals() {
|
|
|
|
PrefLocationService.distance_threshold = -123
|
|
|
|
PrefLocationService.time_threshold = -12
|
|
|
|
|
|
|
|
compare(spyCatcher.spy1, true)
|
|
|
|
compare(spyCatcher.spy2, true)
|
|
|
|
}
|
2018-08-06 16:45:32 +00:00
|
|
|
}
|