summaryrefslogtreecommitdiffstats
path: root/tests/tst_qPrefPartialPressureGas.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_qPrefPartialPressureGas.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_qPrefPartialPressureGas.qml')
-rw-r--r--tests/tst_qPrefPartialPressureGas.qml41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/tst_qPrefPartialPressureGas.qml b/tests/tst_qPrefPartialPressureGas.qml
index 5000a3dae..e927fdfc2 100644
--- a/tests/tst_qPrefPartialPressureGas.qml
+++ b/tests/tst_qPrefPartialPressureGas.qml
@@ -34,4 +34,45 @@ TestCase {
PrefPartialPressureGas.po2_threshold_min = 21.5
compare(PrefPartialPressureGas.po2_threshold_min, 21.5)
}
+
+ Item {
+ id: spyCatcher
+
+ property bool spy1 : false
+ property bool spy2 : false
+ property bool spy3 : false
+ property bool spy4 : false
+ property bool spy5 : false
+ property bool spy6 : false
+ property bool spy7 : false
+
+ Connections {
+ target: PrefPartialPressureGas
+ onPheChanged: {spyCatcher.spy1 = true }
+ onPhe_thresholdChanged: {spyCatcher.spy2 = true }
+ onPn2Changed: {spyCatcher.spy3 = true }
+ onPn2_thresholdChanged: {spyCatcher.spy4 = true }
+ onPo2Changed: {spyCatcher.spy5 = true }
+ onPo2_threshold_maxChanged: {spyCatcher.spy6 = true }
+ onPo2_threshold_minChanged: {spyCatcher.spy7 = true }
+ }
+ }
+
+ function test_signals() {
+ PrefPartialPressureGas.phe = ! PrefPartialPressureGas.phe
+ PrefPartialPressureGas.phe_threshold = -21.2
+ PrefPartialPressureGas.pn2 = ! PrefPartialPressureGas.pn2
+ PrefPartialPressureGas.pn2_threshold = -21.3
+ PrefPartialPressureGas.po2 = ! PrefPartialPressureGas.po2
+ PrefPartialPressureGas.po2_threshold_max = -21.4
+ PrefPartialPressureGas.po2_threshold_min = -21.5
+
+ compare(spyCatcher.spy1, true)
+ compare(spyCatcher.spy2, true)
+ compare(spyCatcher.spy3, true)
+ compare(spyCatcher.spy4, true)
+ compare(spyCatcher.spy5, true)
+ compare(spyCatcher.spy6, true)
+ compare(spyCatcher.spy7, true)
+ }
}