summaryrefslogtreecommitdiffstats
path: root/tests/tst_qPrefCloudStorage.qml
blob: 8d58c72772e0de41f596158c379551ce32210832 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6
import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0

TestCase {
	name: "qPrefCloudStorage"

	function test_variables() {
		var x1 = PrefCloudStorage.cloud_base_url
		PrefCloudStorage.cloud_base_url = "my url"
		compare(PrefCloudStorage.cloud_base_url, "my url")

		var x2 = PrefCloudStorage.cloud_git_url
		compare(PrefCloudStorage.cloud_git_url, "my url/git")

		var x3 = PrefCloudStorage.cloud_storage_email
		PrefCloudStorage.cloud_storage_email = "my email"
		compare(PrefCloudStorage.cloud_storage_email, "my email")

		var x4 = PrefCloudStorage.cloud_storage_email_encoded
		PrefCloudStorage.cloud_storage_email_encoded= "my email enc"
		compare(PrefCloudStorage.cloud_storage_email_encoded, "my email enc")

		var x5 = PrefCloudStorage.cloud_storage_password
		PrefCloudStorage.cloud_storage_password = "my url"
		compare(PrefCloudStorage.cloud_storage_password, "my url")

		var x6 = PrefCloudStorage.cloud_storage_pin
		PrefCloudStorage.cloud_storage_pin= "my pin"
		compare(PrefCloudStorage.cloud_storage_pin, "my pin")

		var x7 = PrefCloudStorage.cloud_timeout
		PrefCloudStorage.cloud_timeout = 137
		compare(PrefCloudStorage.cloud_timeout, 137)

		var x8 = PrefCloudStorage.cloud_verification_status
		PrefCloudStorage.cloud_verification_status = 1
		PrefCloudStorage.cloud_verification_status = CloudStatus.CS_VERIFIED
		compare(PrefCloudStorage.cloud_verification_status, CloudStatus.CS_VERIFIED)

		var x9 = PrefCloudStorage.save_password_local
		PrefCloudStorage.save_password_local = true
		compare(PrefCloudStorage.save_password_local, true)

		var x10 = PrefCloudStorage.save_userid_local
		PrefCloudStorage.save_userid_local = true
		compare(PrefCloudStorage.save_userid_local, true)

		var x11 = PrefCloudStorage.userid
		PrefCloudStorage.userid = "my user"
		compare(PrefCloudStorage.userid, "my user")
	}
}