tests: update qml test cases

use new qml registration

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-09-07 13:53:00 +02:00 committed by Dirk Hohndel
parent 684e334fb6
commit 1ee7265972
15 changed files with 433 additions and 543 deletions

View file

@ -1,17 +1,12 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPref" name: "qPref"
SsrfPrefs {
id: prefs
}
function test_register() { function test_register() {
var x = prefs.mobile_version var x = Pref.mobile_version
compare(x, prefs.mobile_version) compare(x, Pref.mobile_version)
} }
} }

View file

@ -6,56 +6,49 @@ import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefCloudStorage" name: "qPrefCloudStorage"
SsrfCloudStoragePrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.cloud_base_url var x1 = PrefCloudStorage.cloud_base_url
tst.cloud_base_url = "my url" PrefCloudStorage.cloud_base_url = "my url"
compare(tst.cloud_base_url, "my url") compare(PrefCloudStorage.cloud_base_url, "my url")
var x2 = tst.cloud_git_url var x2 = PrefCloudStorage.cloud_git_url
compare(tst.cloud_git_url, "my url/git") compare(PrefCloudStorage.cloud_git_url, "my url/git")
var x3 = tst.cloud_storage_email var x3 = PrefCloudStorage.cloud_storage_email
tst.cloud_storage_email = "my email" PrefCloudStorage.cloud_storage_email = "my email"
compare(tst.cloud_storage_email, "my email") compare(PrefCloudStorage.cloud_storage_email, "my email")
var x4 = tst.cloud_storage_email_encoded var x4 = PrefCloudStorage.cloud_storage_email_encoded
tst.cloud_storage_email_encoded= "my email enc" PrefCloudStorage.cloud_storage_email_encoded= "my email enc"
compare(tst.cloud_storage_email_encoded, "my email enc") compare(PrefCloudStorage.cloud_storage_email_encoded, "my email enc")
var x6 = tst.cloud_storage_password var x5 = PrefCloudStorage.cloud_storage_password
tst.cloud_storage_password = "my url" PrefCloudStorage.cloud_storage_password = "my url"
compare(tst.cloud_storage_password, "my url") compare(PrefCloudStorage.cloud_storage_password, "my url")
var x7 = tst.cloud_storage_pin var x6 = PrefCloudStorage.cloud_storage_pin
tst.cloud_storage_pin= "my pin" PrefCloudStorage.cloud_storage_pin= "my pin"
compare(tst.cloud_storage_pin, "my pin") compare(PrefCloudStorage.cloud_storage_pin, "my pin")
var x8 = tst.cloud_timeout var x7 = PrefCloudStorage.cloud_timeout
tst.cloud_timeout = 137 PrefCloudStorage.cloud_timeout = 137
compare(tst.cloud_timeout, 137) compare(PrefCloudStorage.cloud_timeout, 137)
var x9 = tst.cloud_verification_status var x8 = PrefCloudStorage.cloud_verification_status
tst.cloud_verification_status = tst.CS_VERIFIED PrefCloudStorage.cloud_verification_status = 1
compare(tst.cloud_verification_status, tst.CS_VERIFIED) PrefCloudStorage.cloud_verification_status = CloudStatus.CS_VERIFIED
compare(PrefCloudStorage.cloud_verification_status, CloudStatus.CS_VERIFIED)
var x11 = tst.save_password_local var x9 = PrefCloudStorage.save_password_local
tst.save_password_local = true PrefCloudStorage.save_password_local = true
compare(tst.save_password_local, true) compare(PrefCloudStorage.save_password_local, true)
var x12 = tst.save_userid_local var x10 = PrefCloudStorage.save_userid_local
tst.save_userid_local = true PrefCloudStorage.save_userid_local = true
compare(tst.save_userid_local, true) compare(PrefCloudStorage.save_userid_local, true)
var x13 = tst.userid var x11 = PrefCloudStorage.userid
tst.userid = "my user" PrefCloudStorage.userid = "my user"
compare(tst.userid, "my user") compare(PrefCloudStorage.userid, "my user")
} }
} }

View file

@ -1,78 +1,79 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefDisplay" name: "qPrefDisplay"
SsrfDisplayPrefs {
id: display
}
function test_variables() { function test_variables() {
var x0 = display.animation_speed var x1 = PrefDisplay.animation_speed
display.animation_speed = 37 PrefDisplay.animation_speed = 37
compare(display.animation_speed, 37) compare(PrefDisplay.animation_speed, 37)
var x1 = display.divelist_font // PrefDisplay.divelist_font is NOT permitted in QML
display.divelist_font = "helvitica" // calling qApp->setFont in the setter crashes in Qt5.11
compare(display.divelist_font, "helvitica") // due to a conflict with the QML font system
// var x2 = PrefDisplay.divelist_font
// PrefDisplay.divelist_font = "helvitica"
// compare(PrefDisplay.divelist_font, "helvitica")
var x2 = display.font_size // PrefDisplay.font_size is NOT permitted in QML
display.font_size = 12.0 // calling qApp->setFont in the setter crashes in Qt5.11
compare(display.font_size, 12.0) // due to a conflict with the QML font system
// var x3 = PrefDisplay.font_size
// PrefDisplay.font_size = 12.0
// compare(PrefDisplay.font_size, 12.0)
var x3 = display.display_invalid_dives var x4 = PrefDisplay.PrefDisplay_invalid_dives
display.display_invalid_dives = !x3 PrefDisplay.PrefDisplay_invalid_dives = !x4
compare(display.display_invalid_dives, !x3) compare(PrefDisplay.PrefDisplay_invalid_dives, !x4)
var x4 = display.show_developer var x5 = PrefDisplay.show_developer
display.show_developer = !x4 PrefDisplay.show_developer = !x4
compare(display.show_developer, !x4) compare(PrefDisplay.show_developer, !x4)
var x5 = display.theme var x6 = PrefDisplay.theme
display.theme = "myColor" PrefDisplay.theme = "myColor"
compare(display.theme, "myColor") compare(PrefDisplay.theme, "myColor")
//TBD var x6 = display.tooltip_position //TBD var x7 = PrefDisplay.tooltip_position
//TBD display.tooltip_position = ?? //TBD PrefDisplay.tooltip_position = ??
//TBD compare(display.tooltip_position, ??) //TBD compare(PrefDisplay.tooltip_position, ??)
var x7 = display.lastDir var x8 = PrefDisplay.lastDir
display.lastDir = "myDir" PrefDisplay.lastDir = "myDir"
compare(display.lastDir, "myDir") compare(PrefDisplay.lastDir, "myDir")
var x8 = display.UserSurvey var x9 = PrefDisplay.UserSurvey
display.UserSurvey = "yes" PrefDisplay.UserSurvey = "yes"
compare(display.UserSurvey, "yes") compare(PrefDisplay.UserSurvey, "yes")
//TBD var x9 = display.mainSplitter //TBD var x10 = PrefDisplay.mainSplitter
//TBD display.mainSplitter = ??? //TBD PrefDisplay.mainSplitter = ???
//TBD compare(display.mainSplitter, ???) //TBD compare(PrefDisplay.mainSplitter, ???)
//TBD var x10 = display.topSplitter //TBD var x11 = PrefDisplay.topSplitter
//TBD display.topSplitter = ??? //TBD PrefDisplay.topSplitter = ???
//TBD compare(display.topSplitter, ???) //TBD compare(PrefDisplay.topSplitter, ???)
//TBD var x11 = display.bottomSplitter //TBD var x12 = PrefDisplay.bottomSplitter
//TBD display.bottomSplitter = ??? //TBD PrefDisplay.bottomSplitter = ???
//TBD compare(display.bottomSplitter, ???) //TBD compare(PrefDisplay.bottomSplitter, ???)
var x12 = display.maximized var x13 = PrefDisplay.maximized
display.maximized = true PrefDisplay.maximized = true
compare(display.maximized, true) compare(PrefDisplay.maximized, true)
//TBD var x13 = display.geometry //TBD var x14 = PrefDisplay.geometry
//TBD display.geometry = ??? //TBD PrefDisplay.geometry = ???
//TBD compare(display.geometry, ???) //TBD compare(PrefDisplay.geometry, ???)
//TBD var x14 = display.windowState //TBD var x15 = PrefDisplay.windowState
//TBD display.windowState = ??? //TBD PrefDisplay.windowState = ???
//TBD compare(display.windowState, ???) //TBD compare(PrefDisplay.windowState, ???)
var x15 = display.lastState var x16 = PrefDisplay.lastState
display.lastState = 17 PrefDisplay.lastState = 17
compare(display.lastState, 17) compare(PrefDisplay.lastState, 17)
} }
} }

View file

@ -1,39 +1,30 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefDiveComputer" name: "qPrefDiveComputer"
SsrfDiveComputerPrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.device var x1 = PrefDiveComputer.device
tst.device = "my device" PrefDiveComputer.device = "my device"
compare(tst.device, "my device") compare(PrefDiveComputer.device, "my device")
var x1 = tst.device_name var x2 = PrefDiveComputer.device_name
tst.device_name = "my device name" PrefDiveComputer.device_name = "my device name"
compare(tst.device_name, "my device name") compare(PrefDiveComputer.device_name, "my device name")
var x1 = tst.download_mode var x3 = PrefDiveComputer.download_mode
tst.download_mode = 19 PrefDiveComputer.download_mode = 19
compare(tst.download_mode, 19) compare(PrefDiveComputer.download_mode, 19)
var x1 = tst.product var x4 = PrefDiveComputer.product
tst.product = "my product" PrefDiveComputer.product = "my product"
compare(tst.product, "my product") compare(PrefDiveComputer.product, "my product")
var x1 = tst.vendor var x5 = PrefDiveComputer.vendor
tst.vendor = "my vendor" PrefDiveComputer.vendor = "my vendor"
compare(tst.vendor, "my vendor") compare(PrefDiveComputer.vendor, "my vendor")
} }
} }

View file

@ -1,119 +1,110 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefDivePlanner" name: "qPrefDivePlanner"
SsrfDivePlannerPrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.ascratelast6m var x1 = PrefDivePlanner.ascratelast6m
tst.ascratelast6m = 11 PrefDivePlanner.ascratelast6m = 11
compare(tst.ascratelast6m, 11) compare(PrefDivePlanner.ascratelast6m, 11)
var x2 = tst.ascratestops var x2 = PrefDivePlanner.ascratestops
tst.ascratestops = 11 PrefDivePlanner.ascratestops = 11
compare(tst.ascratestops, 11) compare(PrefDivePlanner.ascratestops, 11)
var x3 = tst.ascrate50 var x3 = PrefDivePlanner.ascrate50
tst.ascrate50 = 12 PrefDivePlanner.ascrate50 = 12
compare(tst.ascrate50, 12) compare(PrefDivePlanner.ascrate50, 12)
var x4 = tst.ascrate75 var x4 = PrefDivePlanner.ascrate75
tst.ascrate75 = 13 PrefDivePlanner.ascrate75 = 13
compare(tst.ascrate75, 13) compare(PrefDivePlanner.ascrate75, 13)
//TBD var x5 = tst.bestmixend //TBD var x5 = PrefDivePlanner.bestmixend
//TBD tst.bestmixend = 51 //TBD PrefDivePlanner.bestmixend = 51
//TBD compare(tst.bestmixend, 51) //TBD compare(PrefDivePlanner.bestmixend, 51)
var x6 = tst.bottompo2 var x6 = PrefDivePlanner.bottompo2
tst.bottompo2 = 14 PrefDivePlanner.bottompo2 = 14
compare(tst.bottompo2,14) compare(PrefDivePlanner.bottompo2,14)
var x7 = tst.bottomsac var x7 = PrefDivePlanner.bottomsac
tst.bottomsac = 15 PrefDivePlanner.bottomsac = 15
compare(tst.bottomsac, 15) compare(PrefDivePlanner.bottomsac, 15)
var x8 = tst.decopo2 var x8 = PrefDivePlanner.decopo2
tst.decopo2 = 16 PrefDivePlanner.decopo2 = 16
compare(tst.decopo2, 16) compare(PrefDivePlanner.decopo2, 16)
var x9 = tst.decosac var x9 = PrefDivePlanner.decosac
tst.decosac = 17 PrefDivePlanner.decosac = 17
compare(tst.decosac, 17) compare(PrefDivePlanner.decosac, 17)
var x10 = tst.descrate var x10 = PrefDivePlanner.descrate
tst.descrate = 18 PrefDivePlanner.descrate = 18
compare(tst.descrate, 18) compare(PrefDivePlanner.descrate, 18)
var x11 = tst.display_duration var x11 = PrefDivePlanner.display_duration
tst.display_duration = true PrefDivePlanner.display_duration = true
compare(tst.display_duration, true) compare(PrefDivePlanner.display_duration, true)
var x12 = tst.display_runtime var x12 = PrefDivePlanner.display_runtime
tst.display_runtime = true PrefDivePlanner.display_runtime = true
compare(tst.display_runtime, true) compare(PrefDivePlanner.display_runtime, true)
var x13 = tst.display_transitions var x13 = PrefDivePlanner.display_transitions
tst.display_transitions = true PrefDivePlanner.display_transitions = true
compare(tst.display_transitions, true) compare(PrefDivePlanner.display_transitions, true)
var x14 = tst.display_variations var x14 = PrefDivePlanner.display_variations
tst.display_variations = true PrefDivePlanner.display_variations = true
compare(tst.display_variations, true) compare(PrefDivePlanner.display_variations, true)
var x15 = tst.doo2breaks var x15 = PrefDivePlanner.doo2breaks
tst.doo2breaks = true PrefDivePlanner.doo2breaks = true
compare(tst.doo2breaks, true) compare(PrefDivePlanner.doo2breaks, true)
var x16 = tst.drop_stone_mode var x16 = PrefDivePlanner.drop_stone_mode
tst.drop_stone_mode = true PrefDivePlanner.drop_stone_mode = true
compare(tst.drop_stone_mode, true) compare(PrefDivePlanner.drop_stone_mode, true)
var x17 = tst.last_stop var x17 = PrefDivePlanner.last_stop
tst.last_stop = true PrefDivePlanner.last_stop = true
compare(tst.last_stop, true) compare(PrefDivePlanner.last_stop, true)
var x18 = tst.min_switch_duration var x18 = PrefDivePlanner.min_switch_duration
tst.min_switch_duration = 19 PrefDivePlanner.min_switch_duration = 19
compare(tst.min_switch_duration, 19) compare(PrefDivePlanner.min_switch_duration, 19)
//TBD var x19 = tst.planner_deco_mode //TBD var x19 = PrefDivePlanner.planner_deco_mode
//TBD tst.planner_deco_mode = BUEHLMANN //TBD PrefDivePlanner.planner_deco_mode = BUEHLMANN
//TBD compare(tst.planner_deco_mode, BUEHLMANN) //TBD compare(PrefDivePlanner.planner_deco_mode, BUEHLMANN)
var x20 = tst.problemsolvingtime var x20 = PrefDivePlanner.problemsolvingtime
tst.problemsolvingtime = 20 PrefDivePlanner.problemsolvingtime = 20
compare(tst.problemsolvingtime, 20) compare(PrefDivePlanner.problemsolvingtime, 20)
var x21 = tst.reserve_gas var x21 = PrefDivePlanner.reserve_gas
tst.reserve_gas = 21 PrefDivePlanner.reserve_gas = 21
compare(tst.reserve_gas, 21) compare(PrefDivePlanner.reserve_gas, 21)
var x22 = tst.sacfactor var x22 = PrefDivePlanner.sacfactor
tst.sacfactor = 22 PrefDivePlanner.sacfactor = 22
compare(tst.sacfactor, 22) compare(PrefDivePlanner.sacfactor, 22)
var x23 = tst.safetystop var x23 = PrefDivePlanner.safetystop
tst.safetystop = true PrefDivePlanner.safetystop = true
compare(tst.safetystop, true) compare(PrefDivePlanner.safetystop, true)
var x24 = tst.switch_at_req_stop var x24 = PrefDivePlanner.switch_at_req_stop
tst.switch_at_req_stop = true PrefDivePlanner.switch_at_req_stop = true
compare(tst.switch_at_req_stop, true) compare(PrefDivePlanner.switch_at_req_stop, true)
var x25 = tst.verbatim_plan var x25 = PrefDivePlanner.verbatim_plan
tst.verbatim_plan = true PrefDivePlanner.verbatim_plan = true
compare(tst.verbatim_plan, true) compare(PrefDivePlanner.verbatim_plan, true)
} }
} }

View file

@ -1,24 +1,21 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefFacebook" name: "qPrefFacebook"
SsrfFacebookPrefs {
id: facebook
}
function test_variables() { function test_variables() {
var x1 = facebook.access_token var x1 = PrefFacebook.access_token
facebook.access_token = "my token" PrefFacebook.access_token = "my token"
compare(facebook.access_token, "my token") compare(PrefFacebook.access_token, "my token")
var x2 = facebook.album_id
facebook.album_id = "my album" var x2 = PrefFacebook.album_id
compare(facebook.album_id, "my album") PrefFacebook.album_id = "my album"
var x1 = facebook.user_id compare(PrefFacebook.album_id, "my album")
facebook.user_id = "my user"
compare(facebook.user_id, "my user") var x3 = PrefFacebook.user_id
PrefFacebook.user_id = "my user"
compare(PrefFacebook.user_id, "my user")
} }
} }

View file

@ -1,70 +1,61 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefGeneral" name: "qPrefGeneral"
SsrfGeneralPrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.auto_recalculate_thumbnails var x1 = PrefGeneral.auto_recalculate_thumbnails
tst.auto_recalculate_thumbnails = true PrefGeneral.auto_recalculate_thumbnails = true
compare(tst.auto_recalculate_thumbnails, true) compare(PrefGeneral.auto_recalculate_thumbnails, true)
var x2 = tst.default_cylinder var x2 = PrefGeneral.default_cylinder
tst.default_cylinder = "my string" PrefGeneral.default_cylinder = "my string"
compare(tst.default_cylinder, "my string") compare(PrefGeneral.default_cylinder, "my string")
var x3 = tst.default_filename var x3 = PrefGeneral.default_filename
tst.default_filename = "my string" PrefGeneral.default_filename = "my string"
compare(tst.default_filename, "my string") compare(PrefGeneral.default_filename, "my string")
//TBD var x4 = tst.default_file_behavior //TBD var x4 = PrefGeneral.default_file_behavior
//TBD tst.default_file_behavior = ?? //TBD PrefGeneral.default_file_behavior = ??
//TBD compare(tst.default_file_behavior, ??) //TBD compare(PrefGeneral.default_file_behavior, ??)
var x5 = tst.defaultsetpoint var x5 = PrefGeneral.defaultsetpoint
tst.defaultsetpoint = 17 PrefGeneral.defaultsetpoint = 17
compare(tst.defaultsetpoint, 17) compare(PrefGeneral.defaultsetpoint, 17)
var x6 = tst.extract_video_thumbnails var x6 = PrefGeneral.extract_video_thumbnails
tst.extract_video_thumbnails = true PrefGeneral.extract_video_thumbnails = true
compare(tst.extract_video_thumbnails, true) compare(PrefGeneral.extract_video_thumbnails, true)
var x7 = tst.extract_video_thumbnails_position var x7 = PrefGeneral.extract_video_thumbnails_position
tst.extract_video_thumbnails_position = 17 PrefGeneral.extract_video_thumbnails_position = 17
compare(tst.extract_video_thumbnails_position, 17) compare(PrefGeneral.extract_video_thumbnails_position, 17)
var x8 = tst.ffmpeg_executable var x8 = PrefGeneral.ffmpeg_executable
tst.ffmpeg_executable = "my string" PrefGeneral.ffmpeg_executable = "my string"
compare(tst.ffmpeg_executable, "my string") compare(PrefGeneral.ffmpeg_executable, "my string")
var x9 = tst.o2consumption var x9 = PrefGeneral.o2consumption
tst.o2consumption = 17 PrefGeneral.o2consumption = 17
compare(tst.o2consumption, 17) compare(PrefGeneral.o2consumption, 17)
var x10 = tst.pscr_ratio var x10 = PrefGeneral.pscr_ratio
tst.pscr_ratio = 17 PrefGeneral.pscr_ratio = 17
compare(tst.pscr_ratio, 17) compare(PrefGeneral.pscr_ratio, 17)
var x11 = tst.use_default_file var x11 = PrefGeneral.use_default_file
tst.use_default_file = true PrefGeneral.use_default_file = true
compare(tst.use_default_file, true) compare(PrefGeneral.use_default_file, true)
var x12 = tst.diveshareExport_uid var x12 = PrefGeneral.diveshareExport_uid
tst.diveshareExport_uid = "myUid" PrefGeneral.diveshareExport_uid = "myUid"
compare(tst.diveshareExport_uid, "myUid") compare(PrefGeneral.diveshareExport_uid, "myUid")
var x13 = tst.diveshareExport_private var x13 = PrefGeneral.diveshareExport_private
tst.diveshareExport_private = true PrefGeneral.diveshareExport_private = true
compare(tst.diveshareExport_private, true) compare(PrefGeneral.diveshareExport_private, true)
} }
} }

View file

@ -1,26 +1,21 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefGeocoding" name: "qPrefGeocoding"
SsrfGeocodingPrefs {
id: geo
}
function test_variables() { function test_variables() {
//TBD var x1 = geo.first_taxonomy_category //TBD var x1 = PrefGeocoding.first_taxonomy_category
//TBD geo.first_taxonomy_category = ?? //TBD PrefGeocoding.first_taxonomy_category = ??
//TBD compare(geo.first_taxonom_categroy, ??) //TBD compare(PrefGeocoding.first_taxonom_categroy, ??)
//TBD var x2 = geo.second_taxonomy_category //TBD var x2 = PrefGeocoding.second_taxonomy_category
//TBD geo.second_taxonomy_category = ?? //TBD PrefGeocoding.second_taxonomy_category = ??
//TBD compare(geo.second_taxonom_categroy, ??) //TBD compare(PrefGeocoding.second_taxonom_categroy, ??)
//TBD var x3 = geo.third_taxonomy_category //TBD var x3 = PrefGeocoding.third_taxonomy_category
//TBD geo.third_taxonomy_category = ?? //TBD PrefGeocoding.third_taxonomy_category = ??
//TBD compare(geo.third_taxonom_categroy, ??) //TBD compare(PrefGeocoding.third_taxonom_categroy, ??)
} }
} }

View file

@ -1,50 +1,40 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefLanguage" name: "qPrefLanguage"
SsrfLanguagePrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.date_format var x1 = PrefLanguage.date_format
tst.date_format = "new date format" PrefLanguage.date_format = "new date format"
compare(tst.date_format, "new date format") compare(PrefLanguage.date_format, "new date format")
var x2 = tst.date_format_override var x2 = PrefLanguage.date_format_override
tst.date_format_override = true PrefLanguage.date_format_override = true
compare(tst.date_format_override, true) compare(PrefLanguage.date_format_override, true)
var x3 = tst.date_format_short var x3 = PrefLanguage.date_format_short
tst.date_format_short = "new short format" PrefLanguage.date_format_short = "new short format"
compare(tst.date_format_short, "new short format") compare(PrefLanguage.date_format_short, "new short format")
var x4 = tst.language var x4 = PrefLanguage.language
tst.language = "new lang format" PrefLanguage.language = "new lang format"
compare(tst.language, "new lang format") compare(PrefLanguage.language, "new lang format")
var x5 = tst.lang_locale var x5 = PrefLanguage.lang_locale
tst.lang_locale = "new loc lang format" PrefLanguage.lang_locale = "new loc lang format"
compare(tst.lang_locale, "new loc lang format") compare(PrefLanguage.lang_locale, "new loc lang format")
var x6 = tst.time_format var x6 = PrefLanguage.time_format
tst.time_format = "new time format" PrefLanguage.time_format = "new time format"
compare(tst.time_format, "new time format") compare(PrefLanguage.time_format, "new time format")
var x7 = tst.time_format_override var x7 = PrefLanguage.time_format_override
tst.time_format_override = true PrefLanguage.time_format_override = true
compare(tst.time_format_override, true) compare(PrefLanguage.time_format_override, true)
var x8 = tst.use_system_language var x8 = PrefLanguage.use_system_language
tst.use_system_language = true PrefLanguage.use_system_language = true
compare(tst.use_system_language, true) compare(PrefLanguage.use_system_language, true)
} }
} }

View file

@ -1,26 +1,17 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefLocationService" name: "qPrefLocationService"
SsrfLocationServicePrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.distance_threshold var x1 = PrefLocationService.distance_threshold
tst.distance_threshold = 123 PrefLocationService.distance_threshold = 123
compare(tst.distance_threshold , 123) compare(PrefLocationService.distance_threshold , 123)
var x2 = tst.time_threshold var x2 = PrefLocationService.time_threshold
tst.time_threshold = 12 PrefLocationService.time_threshold = 12
compare(tst.time_threshold , 12) compare(PrefLocationService.time_threshold , 12)
} }
} }

View file

@ -1,46 +1,37 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefPartialPressureGas" name: "qPrefPartialPressureGas"
SsrfPartialPressureGasPrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.phe = true var x1 = PrefPartialPressureGas.phe = true
tst.phe = true PrefPartialPressureGas.phe = true
compare(tst.phe, true) compare(PrefPartialPressureGas.phe, true)
var x2 = tst.phe_threshold = 21.2 var x2 = PrefPartialPressureGas.phe_threshold = 21.2
tst.phe_threshold = 21.2 PrefPartialPressureGas.phe_threshold = 21.2
compare(tst.phe_threshold, 21.2) compare(PrefPartialPressureGas.phe_threshold, 21.2)
var x3 = tst.pn2 = true var x3 = PrefPartialPressureGas.pn2 = true
tst.pn2 = true PrefPartialPressureGas.pn2 = true
compare(tst.pn2, true) compare(PrefPartialPressureGas.pn2, true)
var x4 = tst.pn2_threshold = 21.3 var x4 = PrefPartialPressureGas.pn2_threshold = 21.3
tst.pn2_threshold = 21.3 PrefPartialPressureGas.pn2_threshold = 21.3
compare(tst.pn2_threshold, 21.3) compare(PrefPartialPressureGas.pn2_threshold, 21.3)
var x5 = tst.po2 = true var x5 = PrefPartialPressureGas.po2 = true
tst.po2 = true PrefPartialPressureGas.po2 = true
compare(tst.po2, true) compare(PrefPartialPressureGas.po2, true)
var x6 = tst.po2_threshold_max = 21.4 var x6 = PrefPartialPressureGas.po2_threshold_max = 21.4
tst.po2_threshold_max = 21.4 PrefPartialPressureGas.po2_threshold_max = 21.4
compare(tst.po2_threshold_max, 21.4) compare(PrefPartialPressureGas.po2_threshold_max, 21.4)
var x7 = tst.po2_threshold_min = 21.5 var x7 = PrefPartialPressureGas.po2_threshold_min = 21.5
tst.po2_threshold_min = 21.5 PrefPartialPressureGas.po2_threshold_min = 21.5
compare(tst.po2_threshold_min, 21.5) compare(PrefPartialPressureGas.po2_threshold_min, 21.5)
} }
} }

View file

@ -1,42 +1,33 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefProxy" name: "qPrefProxy"
SsrfProxyPrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.proxy_auth var x1 = PrefProxy.proxy_auth
tst.proxy_auth = true PrefProxy.proxy_auth = true
compare(tst.proxy_auth, true) compare(PrefProxy.proxy_auth, true)
var x2 = tst.proxy_host var x2 = PrefProxy.proxy_host
tst.proxy_host = "my host" PrefProxy.proxy_host = "my host"
compare(tst.proxy_host, "my host") compare(PrefProxy.proxy_host, "my host")
var x3 = tst.proxy_pass var x3 = PrefProxy.proxy_pass
tst.proxy_pass = "my pass" PrefProxy.proxy_pass = "my pass"
compare(tst.proxy_pass, "my pass") compare(PrefProxy.proxy_pass, "my pass")
var x3 = tst.proxy_port var x4 = PrefProxy.proxy_port
tst.proxy_port = 544 PrefProxy.proxy_port = 544
compare(tst.proxy_port, 544) compare(PrefProxy.proxy_port, 544)
var x5 = tst.proxy_type var x5 = PrefProxy.proxy_type
tst.proxy_type = 3 PrefProxy.proxy_type = 3
compare(tst.proxy_type, 3) compare(PrefProxy.proxy_type, 3)
var x3 = tst.proxy_user var x6 = PrefProxy.proxy_user
tst.proxy_user = "my user" PrefProxy.proxy_user = "my user"
compare(tst.proxy_user, "my user") compare(PrefProxy.proxy_user, "my user")
} }
} }

View file

@ -1,126 +1,117 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefTechnicalDetails" name: "qPrefTechnicalDetails"
SsrfTechnicalDetailsPrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x01 = tst.calcalltissues var x01 = PrefTechnicalDetails.calcalltissues
tst.calcalltissues = true PrefTechnicalDetails.calcalltissues = true
compare(tst.calcalltissues, true) compare(PrefTechnicalDetails.calcalltissues, true)
var x02 = tst.calcceiling var x02 = PrefTechnicalDetails.calcceiling
tst.calcceiling = true PrefTechnicalDetails.calcceiling = true
compare(tst.calcceiling, true) compare(PrefTechnicalDetails.calcceiling, true)
var x03 = tst.calcceiling3m var x03 = PrefTechnicalDetails.calcceiling3m
tst.calcceiling3m = true PrefTechnicalDetails.calcceiling3m = true
compare(tst.calcceiling3m, true) compare(PrefTechnicalDetails.calcceiling3m, true)
var x04 = tst.calcndltts var x04 = PrefTechnicalDetails.calcndltts
tst.calcndltts = true PrefTechnicalDetails.calcndltts = true
compare(tst.calcndltts, true) compare(PrefTechnicalDetails.calcndltts, true)
var x05 = tst.dcceiling var x05 = PrefTechnicalDetails.dcceiling
tst.dcceiling = true PrefTechnicalDetails.dcceiling = true
compare(tst.dcceiling, true) compare(PrefTechnicalDetails.dcceiling, true)
//TBD var x06 = tst.display_deco_mode //TBD var x06 = PrefTechnicalDetails.display_deco_mode
//TBD tst.display_deco_mode = BUEHLMANN //TBD PrefTechnicalDetails.display_deco_mode = BUEHLMANN
//TBD compare(tst.display_deco_mode, BUEHLMANN) //TBD compare(PrefTechnicalDetails.display_deco_mode, BUEHLMANN)
var x07 = tst.display_unused_tanks var x07 = PrefTechnicalDetails.display_unused_tanks
tst.display_unused_tanks = true PrefTechnicalDetails.display_unused_tanks = true
compare(tst.display_unused_tanks, true) compare(PrefTechnicalDetails.display_unused_tanks, true)
var x08 = tst.ead var x08 = PrefTechnicalDetails.ead
tst.ead = true PrefTechnicalDetails.ead = true
compare(tst.ead, true) compare(PrefTechnicalDetails.ead, true)
var x09 = tst.gfhigh var x09 = PrefTechnicalDetails.gfhigh
tst.gfhigh = 27 PrefTechnicalDetails.gfhigh = 27
compare(tst.gfhigh, 27) compare(PrefTechnicalDetails.gfhigh, 27)
var x10 = tst.gflow var x10 = PrefTechnicalDetails.gflow
tst.gflow = 25 PrefTechnicalDetails.gflow = 25
compare(tst.gflow, 25) compare(PrefTechnicalDetails.gflow, 25)
var x11 = tst.gf_low_at_maxdepth var x11 = PrefTechnicalDetails.gf_low_at_maxdepth
tst.gf_low_at_maxdepth = true PrefTechnicalDetails.gf_low_at_maxdepth = true
compare(tst.gf_low_at_maxdepth, true) compare(PrefTechnicalDetails.gf_low_at_maxdepth, true)
var x12 = tst.hrgraph var x12 = PrefTechnicalDetails.hrgraph
tst.hrgraph = true PrefTechnicalDetails.hrgraph = true
compare(tst.hrgraph, true) compare(PrefTechnicalDetails.hrgraph, true)
var x13 = tst.mod var x13 = PrefTechnicalDetails.mod
tst.mod = true PrefTechnicalDetails.mod = true
compare(tst.mod, true) compare(PrefTechnicalDetails.mod, true)
var x14 = tst.modpO2 = 1.02; var x14 = PrefTechnicalDetails.modpO2 = 1.02;
tst.modpO2 = 1.02 PrefTechnicalDetails.modpO2 = 1.02
compare(tst.modpO2, 1.02) compare(PrefTechnicalDetails.modpO2, 1.02)
var x15 = tst.percentagegraph var x15 = PrefTechnicalDetails.percentagegraph
tst.percentagegraph = true PrefTechnicalDetails.percentagegraph = true
compare(tst.percentagegraph, true) compare(PrefTechnicalDetails.percentagegraph, true)
var x16 = tst.redceiling var x16 = PrefTechnicalDetails.redceiling
tst.redceiling = true PrefTechnicalDetails.redceiling = true
compare(tst.redceiling, true) compare(PrefTechnicalDetails.redceiling, true)
var x17 = tst.rulergraph var x17 = PrefTechnicalDetails.rulergraph
tst.rulergraph = true PrefTechnicalDetails.rulergraph = true
compare(tst.rulergraph, true) compare(PrefTechnicalDetails.rulergraph, true)
var x18 = tst.show_average_depth var x18 = PrefTechnicalDetails.show_average_depth
tst.show_average_depth = true PrefTechnicalDetails.show_average_depth = true
compare(tst.show_average_depth, true) compare(PrefTechnicalDetails.show_average_depth, true)
var x19 = tst.show_ccr_sensors var x19 = PrefTechnicalDetails.show_ccr_sensors
tst.show_ccr_sensors = true PrefTechnicalDetails.show_ccr_sensors = true
compare(tst.show_ccr_sensors, true) compare(PrefTechnicalDetails.show_ccr_sensors, true)
var x20 = tst.show_ccr_setpoint var x20 = PrefTechnicalDetails.show_ccr_setpoint
tst.show_ccr_setpoint = true PrefTechnicalDetails.show_ccr_setpoint = true
compare(tst.show_ccr_setpoint, true) compare(PrefTechnicalDetails.show_ccr_setpoint, true)
var x21 = tst.show_icd var x21 = PrefTechnicalDetails.show_icd
tst.show_icd = true PrefTechnicalDetails.show_icd = true
compare(tst.show_icd, true) compare(PrefTechnicalDetails.show_icd, true)
var x22 = tst.show_pictures_in_profile var x22 = PrefTechnicalDetails.show_pictures_in_profile
tst.show_pictures_in_profile = true PrefTechnicalDetails.show_pictures_in_profile = true
compare(tst.show_pictures_in_profile, true) compare(PrefTechnicalDetails.show_pictures_in_profile, true)
var x23 = tst.show_sac var x23 = PrefTechnicalDetails.show_sac
tst.show_sac = true PrefTechnicalDetails.show_sac = true
compare(tst.show_sac, true) compare(PrefTechnicalDetails.show_sac, true)
var x24 = tst.show_scr_ocpo2 var x24 = PrefTechnicalDetails.show_scr_ocpo2
tst.show_scr_ocpo2 = true PrefTechnicalDetails.show_scr_ocpo2 = true
compare(tst.show_scr_ocpo2, true) compare(PrefTechnicalDetails.show_scr_ocpo2, true)
var x25 = tst.tankbar var x25 = PrefTechnicalDetails.tankbar
tst.tankbar = true PrefTechnicalDetails.tankbar = true
compare(tst.tankbar, true) compare(PrefTechnicalDetails.tankbar, true)
var x26 = tst.vpmb_conservatism var x26 = PrefTechnicalDetails.vpmb_conservatism
tst.vpmb_conservatism = 127 PrefTechnicalDetails.vpmb_conservatism = 127
compare(tst.vpmb_conservatism, 127) compare(PrefTechnicalDetails.vpmb_conservatism, 127)
var x27 = tst.zoomed_plot var x27 = PrefTechnicalDetails.zoomed_plot
tst.zoomed_plot = true PrefTechnicalDetails.zoomed_plot = true
compare(tst.zoomed_plot, true) compare(PrefTechnicalDetails.zoomed_plot, true)
} }
} }

View file

@ -1,58 +1,49 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefUnits" name: "qPrefUnits"
SsrfUnitPrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.coordinates_traditional var x1 = PrefUnits.coordinates_traditional
tst.coordinates_traditional = true PrefUnits.coordinates_traditional = true
compare(tst.coordinates_traditional, true) compare(PrefUnits.coordinates_traditional, true)
//TBD var x2 = tst.duration_units //TBD var x2 = PrefUnits.duration_units
//TBD tst.duration_units = ?? //TBD PrefUnits.duration_units = ??
//TBD compare(tst.duration_units, ??) //TBD compare(PrefUnits.duration_units, ??)
//TBD var x3 = tst.length //TBD var x3 = PrefUnits.length
//TBD tst.=length = ?? //TBD PrefUnits.=length = ??
//TBD compare(tst.length, ??) //TBD compare(PrefUnits.length, ??)
//TBD var x4 = tst.pressure //TBD var x4 = PrefUnits.pressure
//TBD tst.pressure = ?? //TBD PrefUnits.pressure = ??
//TBD compare(tst.pressure, ??) //TBD compare(PrefUnits.pressure, ??)
var x5 = tst.show_units_table var x5 = PrefUnits.show_units_table
tst.show_units_table = true PrefUnits.show_units_table = true
compare(tst.show_units_table, true) compare(PrefUnits.show_units_table, true)
//TBD var x6 = tst.temperature //TBD var x6 = PrefUnits.temperature
//TBD tst.temperature = ?? //TBD PrefUnits.temperature = ??
//TBD compare(tst.temperature, ??) //TBD compare(PrefUnits.temperature, ??)
var x7 = tst.unit_system var x7 = PrefUnits.unit_system
tst.unit_system = "metric" PrefUnits.unit_system = "metric"
compare(tst.unit_system, "metric") compare(PrefUnits.unit_system, "metric")
//TBD var x8 = tst.vertical_speed_time //TBD var x8 = PrefUnits.vertical_speed_time
//TBD tst.vertical_speed_time = ?? //TBD PrefUnits.vertical_speed_time = ??
//TBD compare(tst.vertical_speed_time, ??) //TBD compare(PrefUnits.vertical_speed_time, ??)
//TBD var x9 = tst.volume //TBD var x9 = PrefUnits.volume
//TBD tst.volume = ?? //TBD PrefUnits.volume = ??
//TBD compare(tst.volume, ??) //TBD compare(PrefUnits.volume, ??)
//TBD var x10 = tst.weight //TBD var x10 = PrefUnits.weight
//TBD tst.weight = ?? //TBD PrefUnits.weight = ??
//TBD compare(tst.weight, ??) //TBD compare(PrefUnits.weight, ??)
} }
} }

View file

@ -1,39 +1,30 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
import QtQuick 2.6 import QtQuick 2.6
import QtTest 1.2 import QtTest 1.2
import org.subsurfacedivelog.mobile 1.0
TestCase { TestCase {
name: "qPrefUpdateManager" name: "qPrefUpdateManager"
SsrfUpdateManagerPrefs {
id: tst
}
SsrfPrefs {
id: prefs
}
function test_variables() { function test_variables() {
var x1 = tst.dont_check_for_updates var x1 = PrefUpdateManager.dont_check_for_updates
tst.dont_check_for_updates = true; PrefUpdateManager.dont_check_for_updates = true;
compare(tst.dont_check_for_updates, true) compare(PrefUpdateManager.dont_check_for_updates, true)
var x2 = tst.dont_check_exists var x2 = PrefUpdateManager.dont_check_exists
tst.dont_check_exists = true PrefUpdateManager.dont_check_exists = true
compare(tst.dont_check_exists, true) compare(PrefUpdateManager.dont_check_exists, true)
var x3 = tst.last_version_used var x3 = PrefUpdateManager.last_version_used
tst.last_version_used = "jan again" PrefUpdateManager.last_version_used = "jan again"
compare(tst.last_version_used, "jan again") compare(PrefUpdateManager.last_version_used, "jan again")
var x4 = tst.next_check var x4 = PrefUpdateManager.next_check
var x4_date = Date.fromLocaleString(Qt.locale(), "01-01-2001", "dd-MM-yyyy") var x4_date = Date.fromLocaleString(Qt.locale(), "01-01-2001", "dd-MM-yyyy")
tst.next_check = x4_date PrefUpdateManager.next_check = x4_date
//TBD compare(tst.next_check, x4_date) //TBD compare(PrefUpdateManager.next_check, x4_date)
var x5 = tst.uuidString var x5 = PrefUpdateManager.uuidString
tst.uuidString = "jan again" PrefUpdateManager.uuidString = "jan again"
compare(tst.uuidString, "jan again") compare(PrefUpdateManager.uuidString, "jan again")
} }
} }