summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-08-04 11:45:18 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-09 08:45:02 -0700
commit607012cccb5dc3533d1ec795ce63fffbf7028336 (patch)
tree3d08a14cfbb247aab52213ba986b8ae0e26b22bd /tests
parent9341ea6eef9cf8573e6b513370424b514753f8ac (diff)
downloadsubsurface-607012cccb5dc3533d1ec795ce63fffbf7028336.tar.gz
tests: add UpdateManager qml test cases
Add tst_qPrefUpdateManager qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/tst_qPrefUpdateManager.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/tst_qPrefUpdateManager.qml b/tests/tst_qPrefUpdateManager.qml
new file mode 100644
index 000000000..3554f88c8
--- /dev/null
+++ b/tests/tst_qPrefUpdateManager.qml
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0
+import QtQuick 2.6
+import QtTest 1.2
+import org.subsurfacedivelog.mobile 1.0
+
+TestCase {
+ name: "qPrefUpdateManager"
+
+ SsrfUpdateManagerPrefs {
+ id: tst
+ }
+
+ SsrfPrefs {
+ id: prefs
+ }
+
+ function test_variables() {
+ var x1 = tst.dont_check_for_updates
+ tst.dont_check_for_updates = true;
+ compare(tst.dont_check_for_updates, true)
+
+ var x2 = tst.dont_check_exists
+ tst.dont_check_exists = true
+ compare(tst.dont_check_exists, true)
+
+ var x3 = tst.last_version_used
+ tst.last_version_used = "jan again"
+ compare(tst.last_version_used, "jan again")
+
+ var x4 = tst.next_check
+ var x4_date = Date.fromLocaleString(Qt.locale(), "01-01-2001", "dd-MM-yyyy")
+ tst.next_check = x4_date
+ compare(tst.next_check, x4_date)
+ }
+}