aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-15 16:10:23 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-21 07:49:25 -0700
commitbe50ee2017b726fdb7fc0a023cd32d91a55350fc (patch)
treeb5ea922a319b6049e5339a49ffcffe1d78feb618
parentbe8e93d28a78b4d58b35eca9e0f097b824a84fa9 (diff)
downloadsubsurface-be50ee2017b726fdb7fc0a023cd32d91a55350fc.tar.gz
tests: add CloudStorage qml test cases
Add tst_qPrefCloudStorage qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
-rw-r--r--tests/tst_qPrefCloudStorage.qml70
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/tst_qPrefCloudStorage.qml b/tests/tst_qPrefCloudStorage.qml
new file mode 100644
index 000000000..cf2928dbd
--- /dev/null
+++ b/tests/tst_qPrefCloudStorage.qml
@@ -0,0 +1,70 @@
+// SPDX-License-Identifier: GPL-2.0
+import QtQuick 2.6
+import QtTest 1.2
+import org.subsurfacedivelog.mobile 1.0
+
+TestCase {
+ name: "qPrefCloudStorage"
+
+ SsrfCloudStoragePrefs {
+ id: tst
+ }
+
+ SsrfPrefs {
+ id: prefs
+ }
+
+ function test_variables() {
+ var x1 = tst.cloud_base_url
+ tst.cloud_base_url = "my url"
+ compare(tst.cloud_base_url, "my url")
+
+ var x2 = tst.cloud_git_url
+ tst.cloud_git_url= "my url"
+ compare(tst.cloud_git_url, "my url")
+
+ var x3 = tst.cloud_storage_email
+ tst.cloud_storage_email = "my email"
+ compare(tst.cloud_storage_email, "my email")
+
+ var x4 = tst.cloud_storage_email_encoded
+ tst.cloud_storage_email_encoded= "my email enc"
+ compare(tst.cloud_storage_email_encoded, "my email enc")
+
+ var x5 = tst.cloud_storage_newpassword
+ tst.cloud_storage_newpassword = "my new password"
+ compare(tst.cloud_storage_newpassword, "my new password")
+
+ var x6 = tst.cloud_storage_password
+ tst.cloud_storage_password = "my url"
+ compare(tst.cloud_storage_password, "my url")
+
+ var x7 = tst.cloud_storage_pin
+ tst.cloud_storage_pin= "my pin"
+ compare(tst.cloud_storage_pin, "my pin")
+
+ var x8 = tst.cloud_timeout
+ tst.cloud_timeout = 137
+ compare(tst.cloud_timeout, 137)
+
+ var x9 = tst.cloud_verification_status
+ tst.cloud_verification_status = SsrfPrefs.CS_VERIFIED
+ compare(tst.cloud_verification_status, SsrfPrefs.CS_VERIFIED)
+
+ var x10 = tst.git_local_only
+ tst.git_local_only = true
+ compare(tst.git_local_only, true)
+
+ var x11 = tst.save_password_local
+ tst.save_password_local = true
+ compare(tst.save_password_local, true)
+
+ var x12 = tst.save_userid_local
+ tst.save_userid_local = true
+ compare(tst.save_userid_local, true)
+
+ var x13 = tst.userid
+ tst.userid = "my user"
+ compare(tst.userid, "my user")
+ }
+}