summaryrefslogtreecommitdiffstats
path: root/tests/tst_qPrefDiveComputer.qml
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-22 18:07:46 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-25 08:35:04 -0700
commitdaf8921d6f5152b835ab44ed97f535d47f3526b1 (patch)
treea4145c336853e2fd6fcc3f0fad0ae6eda0ffd97b /tests/tst_qPrefDiveComputer.qml
parent87b00aea2b120fefea36d3c86e35babc01720f3f (diff)
downloadsubsurface-daf8921d6f5152b835ab44ed97f535d47f3526b1.tar.gz
tests: add DiveComputer qml test cases
Add tst_qPrefDiveComputer qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests/tst_qPrefDiveComputer.qml')
-rw-r--r--tests/tst_qPrefDiveComputer.qml39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/tst_qPrefDiveComputer.qml b/tests/tst_qPrefDiveComputer.qml
new file mode 100644
index 000000000..4fe105f47
--- /dev/null
+++ b/tests/tst_qPrefDiveComputer.qml
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0
+import QtQuick 2.6
+import QtTest 1.2
+import org.subsurfacedivelog.mobile 1.0
+
+TestCase {
+ name: "qPrefDiveComputer"
+
+ SsrfDiveComputerPrefs {
+ id: tst
+ }
+
+ SsrfPrefs {
+ id: prefs
+ }
+
+ function test_variables() {
+ var x1 = tst.device
+ tst.device = "my device"
+ compare(tst.device, "my device")
+
+ var x1 = tst.device_name
+ tst.device_name = "my device name"
+ compare(tst.device_name, "my device name")
+
+ var x1 = tst.download_mode
+ tst.download_mode = 19
+ compare(tst.download_mode, 19)
+
+ var x1 = tst.product
+ tst.product = "my product"
+ compare(tst.product, "my product")
+
+ var x1 = tst.vendor
+ tst.vendor = "my vendor"
+ compare(tst.vendor, "my vendor")
+ }
+}
+