summaryrefslogtreecommitdiffstats
path: root/tests/tst_qPrefGeneral.qml
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-08-13 22:16:51 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-14 09:09:06 -0700
commitf2c45c81878bd62e5a37e3cb7f26961e6286d1cd (patch)
tree52d000adbd24327272951c69e70dd010236eddc8 /tests/tst_qPrefGeneral.qml
parent91ec0fe8d40d619c32fab30c45565a7a2f24a749 (diff)
downloadsubsurface-f2c45c81878bd62e5a37e3cb7f26961e6286d1cd.tar.gz
tests: add General qml test cases
Add tst_qPrefGeneral qml file to test C++ qml connection 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
new file mode 100644
index 000000000..eb66383af
--- /dev/null
+++ b/tests/tst_qPrefGeneral.qml
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: GPL-2.0
+import QtQuick 2.6
+import QtTest 1.2
+import org.subsurfacedivelog.mobile 1.0
+
+TestCase {
+ name: "qPrefGeneral"
+
+ SsrfGeneralPrefs {
+ id: tst
+ }
+
+ SsrfPrefs {
+ id: prefs
+ }
+
+ function test_variables() {
+ var x1 = tst.auto_recalculate_thumbnails
+ tst.auto_recalculate_thumbnails = true
+ compare(tst.auto_recalculate_thumbnails, true)
+
+ var x2 = tst.default_cylinder
+ tst.default_cylinder = "my string"
+ compare(tst.default_cylinder, "my string")
+
+ var x3 = tst.default_filename
+ tst.default_filename = "my string"
+ compare(tst.default_filename, "my string")
+
+//TBD var x4 = tst.default_file_behavior
+//TBD tst.default_file_behavior = ??
+//TBD compare(tst.default_file_behavior, ??)
+
+ var x5 = tst.defaultsetpoint
+ tst.defaultsetpoint = 17
+ compare(tst.defaultsetpoint, 17)
+
+ var x6 = tst.extract_video_thumbnails
+ tst.extract_video_thumbnails = true
+ compare(tst.extract_video_thumbnails, true)
+
+ var x7 = tst.extract_video_thumbnails_position
+ tst.extract_video_thumbnails_position = 17
+ compare(tst.extract_video_thumbnails_position, 17)
+
+ var x8 = tst.ffmpeg_executable
+ tst.ffmpeg_executable = "my string"
+ compare(tst.ffmpeg_executable, "my string")
+
+ var x9 = tst.o2consumption
+ tst.o2consumption = 17
+ compare(tst.o2consumption, 17)
+
+ var x10 = tst.pscr_ratio
+ tst.pscr_ratio = 17
+ compare(tst.pscr_ratio, 17)
+
+ var x11 = tst.use_default_file
+ tst.use_default_file = true
+ compare(tst.use_default_file, true)
+ }
+}