summaryrefslogtreecommitdiffstats
path: root/tests/tst_qPrefGeneral.qml
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-08-28 12:33:47 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-11 17:25:00 -0700
commit848d2779519b365ba3cfd17838680f5b0cf6eb32 (patch)
tree6a6de26e370994fd018b37591a223b36dfd2f122 /tests/tst_qPrefGeneral.qml
parentc01d9f60c14ec9ee58892504e9f5c346dbb24e7e (diff)
downloadsubsurface-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_qPrefGeneral.qml')
-rw-r--r--tests/tst_qPrefGeneral.qml62
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/tst_qPrefGeneral.qml b/tests/tst_qPrefGeneral.qml
index c78ada6e9..249603b03 100644
--- a/tests/tst_qPrefGeneral.qml
+++ b/tests/tst_qPrefGeneral.qml
@@ -58,4 +58,66 @@ TestCase {
PrefGeneral.diveshareExport_private = true
compare(PrefGeneral.diveshareExport_private, true)
}
+
+ Item {
+ id: spyCatcher
+
+ property bool spy1 : false
+ property bool spy2 : false
+ property bool spy3 : false
+ property bool spy5 : false
+ property bool spy6 : false
+ property bool spy7 : false
+ property bool spy8 : false
+ property bool spy9 : false
+ property bool spy10 : false
+ property bool spy11 : false
+ property bool spy12 : false
+ property bool spy13 : false
+
+ Connections {
+ target: PrefGeneral
+ onAuto_recalculate_thumbnailsChanged: {spyCatcher.spy1 = true }
+ onDefault_cylinderChanged: {spyCatcher.spy2 = true }
+ onDefault_filenameChanged: {spyCatcher.spy3 = true }
+ onDefaultsetpointChanged: {spyCatcher.spy5 = true }
+ onExtract_video_thumbnailsChanged: {spyCatcher.spy6 = true }
+ onExtract_video_thumbnails_positionChanged: {spyCatcher.spy7 = true }
+ onFfmpeg_executableChanged: {spyCatcher.spy8 = true }
+ onO2consumptionChanged: {spyCatcher.spy9 = true }
+ onPscr_ratioChanged: {spyCatcher.spy10 = true }
+ onUse_default_fileChanged: {spyCatcher.spy11 = true }
+ onDiveshareExport_uidChanged: {spyCatcher.spy12 = true }
+ onDiveshareExport_privateChanged: {spyCatcher.spy13 = true }
+ }
+ }
+
+ function test_signals() {
+ PrefGeneral.auto_recalculate_thumbnails = ! PrefGeneral.auto_recalculate_thumbnails
+ PrefGeneral.default_cylinder = "qml"
+ PrefGeneral.default_filename = "qml"
+ // 4 is not emitting signals
+ PrefGeneral.defaultsetpoint = -17
+ PrefGeneral.extract_video_thumbnails = ! PrefGeneral.extract_video_thumbnails
+ PrefGeneral.extract_video_thumbnails_position = -17
+ PrefGeneral.ffmpeg_executable = "qml"
+ PrefGeneral.o2consumption = -17
+ PrefGeneral.pscr_ratio = -17
+ PrefGeneral.use_default_file = ! PrefGeneral.use_default_file
+ PrefGeneral.diveshareExport_uid = "qml"
+ PrefGeneral.diveshareExport_private = ! PrefGeneral.diveshareExport_private
+
+ compare(spyCatcher.spy1, true)
+ compare(spyCatcher.spy2, true)
+ compare(spyCatcher.spy3, true)
+ compare(spyCatcher.spy5, true)
+ compare(spyCatcher.spy6, true)
+ compare(spyCatcher.spy7, true)
+ compare(spyCatcher.spy8, true)
+ compare(spyCatcher.spy9, true)
+ compare(spyCatcher.spy10, true)
+ compare(spyCatcher.spy11, true)
+ compare(spyCatcher.spy12, true)
+ compare(spyCatcher.spy13, true)
+ }
}