mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
tests: add signal test to call tst_qPref*qml
Add signal testing of all variables Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
c01d9f60c1
commit
848d277951
14 changed files with 682 additions and 3 deletions
|
|
@ -26,5 +26,38 @@ TestCase {
|
|||
PrefDiveComputer.vendor = "my vendor"
|
||||
compare(PrefDiveComputer.vendor, "my vendor")
|
||||
}
|
||||
|
||||
Item {
|
||||
id: spyCatcher
|
||||
|
||||
property bool spy1 : false
|
||||
property bool spy2 : false
|
||||
property bool spy3 : false
|
||||
property bool spy4 : false
|
||||
property bool spy5 : false
|
||||
|
||||
Connections {
|
||||
target: PrefDiveComputer
|
||||
onDeviceChanged: {spyCatcher.spy1 = true }
|
||||
onDevice_nameChanged: {spyCatcher.spy2 = true }
|
||||
onDownload_modeChanged: {spyCatcher.spy3 = true }
|
||||
onProductChanged: {spyCatcher.spy4 = true }
|
||||
onVendorChanged: {spyCatcher.spy5 = true }
|
||||
}
|
||||
}
|
||||
|
||||
function test_signals() {
|
||||
PrefDiveComputer.device = "qml"
|
||||
PrefDiveComputer.device_name = "qml"
|
||||
PrefDiveComputer.download_mode = -19
|
||||
PrefDiveComputer.product = "qml"
|
||||
PrefDiveComputer.vendor = "qml"
|
||||
|
||||
compare(spyCatcher.spy1, true)
|
||||
compare(spyCatcher.spy2, true)
|
||||
compare(spyCatcher.spy3, true)
|
||||
compare(spyCatcher.spy4, true)
|
||||
compare(spyCatcher.spy5, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue