aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-11 09:25:52 +0200
committerGravatar jan Iversen <jani@apache.org>2018-07-12 19:01:31 +0200
commitb41fa07efadab526bd7df3a6637ed7e35c5ac62f (patch)
tree0369ea2e5e83a55ec5264a9b2a0e1fa1c1c73ebc /tests
parent1ef3f61cc9ce312e6a8649d7946e1b06b4febc9e (diff)
downloadsubsurface-b41fa07efadab526bd7df3a6637ed7e35c5ac62f.tar.gz
tests: add qPrefDisplay qml testcases
add test of qml C++ interface Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/tst_qPrefDisplay.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/tst_qPrefDisplay.qml b/tests/tst_qPrefDisplay.qml
new file mode 100644
index 000000000..eafcadee1
--- /dev/null
+++ b/tests/tst_qPrefDisplay.qml
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0
+import QtQuick 2.6
+import QtTest 1.2
+import org.subsurfacedivelog.mobile 1.0
+
+TestCase {
+ name: "qPref"
+
+ SsrfDisplayPrefs {
+ id: display
+ }
+
+ function test_variables() {
+ var x1 = display.divelist_font
+ display.divelist_font = "helvitica"
+ compare(display.divelist_font, "helvitica")
+ var x2 = display.font_size
+ display.font_size = 12.0
+ compare(display.font_size, 12.0)
+ var x3 = display.display_invalid_dives
+ display.display_invalid_dives = !x3
+ compare(display.display_invalid_dives, !x3)
+ var x4 = display.show_developer
+ display.show_developer = !x4
+ compare(display.show_developer, !x4)
+ var x5 = display.theme
+ display.theme = "myColor"
+ compare(display.theme, "myColor")
+ }
+
+}