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_qPrefUpdateManager.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_qPrefUpdateManager.qml')
-rw-r--r-- | tests/tst_qPrefUpdateManager.qml | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/tst_qPrefUpdateManager.qml b/tests/tst_qPrefUpdateManager.qml index 4772ada62..18bd577fd 100644 --- a/tests/tst_qPrefUpdateManager.qml +++ b/tests/tst_qPrefUpdateManager.qml @@ -7,7 +7,7 @@ TestCase { function test_variables() { var x1 = PrefUpdateManager.dont_check_for_updates - PrefUpdateManager.dont_check_for_updates = true; + PrefUpdateManager.dont_check_for_updates = true compare(PrefUpdateManager.dont_check_for_updates, true) var x2 = PrefUpdateManager.dont_check_exists @@ -27,4 +27,38 @@ TestCase { PrefUpdateManager.uuidString = "jan again" compare(PrefUpdateManager.uuidString, "jan again") } + + 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: PrefUpdateManager + onDont_check_for_updatesChanged: {spyCatcher.spy1 = true } + onDont_check_existsChanged: {spyCatcher.spy2 = true } + onLast_version_usedChanged: {spyCatcher.spy3 = true } + onNext_checkChanged: {spyCatcher.spy4 = true } + onUuidStringChanged: {spyCatcher.spy5 = true } + } + } + + function test_signals() { + PrefUpdateManager.dont_check_for_updates = ! PrefUpdateManager.dont_check_for_updates + PrefUpdateManager.dont_check_exists = ! PrefUpdateManager.dont_check_exists + PrefUpdateManager.last_version_used = "qml" + var x4_date = Date.fromLocaleString(Qt.locale(), "01-01-2010", "dd-MM-yyyy") + PrefUpdateManager.next_check = x4_date + PrefUpdateManager.uuidString = "qml" + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + } } |