diff options
author | jan Iversen <jani@apache.org> | 2018-08-28 12:33:47 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-11 17:25:00 -0700 |
commit | 848d2779519b365ba3cfd17838680f5b0cf6eb32 (patch) | |
tree | 6a6de26e370994fd018b37591a223b36dfd2f122 /tests/tst_qPrefDiveComputer.qml | |
parent | c01d9f60c14ec9ee58892504e9f5c346dbb24e7e (diff) | |
download | subsurface-848d2779519b365ba3cfd17838680f5b0cf6eb32.tar.gz |
tests: add signal test to call tst_qPref*qml
Add signal testing of all variables
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests/tst_qPrefDiveComputer.qml')
-rw-r--r-- | tests/tst_qPrefDiveComputer.qml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/tst_qPrefDiveComputer.qml b/tests/tst_qPrefDiveComputer.qml index 46ab96a2f..55554b2df 100644 --- a/tests/tst_qPrefDiveComputer.qml +++ b/tests/tst_qPrefDiveComputer.qml @@ -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) + } } |