diff options
author | jan Iversen <jani@apache.org> | 2018-08-28 12:33:47 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-11 17:25:00 -0700 |
commit | 848d2779519b365ba3cfd17838680f5b0cf6eb32 (patch) | |
tree | 6a6de26e370994fd018b37591a223b36dfd2f122 /tests | |
parent | c01d9f60c14ec9ee58892504e9f5c346dbb24e7e (diff) | |
download | subsurface-848d2779519b365ba3cfd17838680f5b0cf6eb32.tar.gz |
tests: add signal test to call tst_qPref*qml
Add signal testing of all variables
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tst_qPrefCloudStorage.qml | 53 | ||||
-rw-r--r-- | tests/tst_qPrefDisplay.qml | 57 | ||||
-rw-r--r-- | tests/tst_qPrefDiveComputer.qml | 33 | ||||
-rw-r--r-- | tests/tst_qPrefDivePlanner.qml | 108 | ||||
-rw-r--r-- | tests/tst_qPrefFacebook.qml | 25 | ||||
-rw-r--r-- | tests/tst_qPrefGeneral.qml | 62 | ||||
-rw-r--r-- | tests/tst_qPrefGeocoding.qml | 23 | ||||
-rw-r--r-- | tests/tst_qPrefLanguage.qml | 45 | ||||
-rw-r--r-- | tests/tst_qPrefLocationService.qml | 21 | ||||
-rw-r--r-- | tests/tst_qPrefPartialPressureGas.qml | 41 | ||||
-rw-r--r-- | tests/tst_qPrefProxy.qml | 37 | ||||
-rw-r--r-- | tests/tst_qPrefTechnicalDetails.qml | 119 | ||||
-rw-r--r-- | tests/tst_qPrefUnits.qml | 25 | ||||
-rw-r--r-- | tests/tst_qPrefUpdateManager.qml | 36 |
14 files changed, 682 insertions, 3 deletions
diff --git a/tests/tst_qPrefCloudStorage.qml b/tests/tst_qPrefCloudStorage.qml index 8d58c7277..f2341218d 100644 --- a/tests/tst_qPrefCloudStorage.qml +++ b/tests/tst_qPrefCloudStorage.qml @@ -51,4 +51,57 @@ TestCase { PrefCloudStorage.userid = "my user" compare(PrefCloudStorage.userid, "my user") } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy3 : false + property bool spy4 : false + property bool spy5 : false + property bool spy6 : false + property bool spy7 : false + property bool spy8 : false + property bool spy9 : false + property bool spy10 : false + property bool spy11 : false + + Connections { + target: PrefCloudStorage + onCloud_base_urlChanged: {spyCatcher.spy1 = true } + onCloud_storage_emailChanged: {spyCatcher.spy3 = true } + onCloud_storage_email_encodedChanged: {spyCatcher.spy4 = true } + onCloud_storage_passwordChanged: {spyCatcher.spy5 = true } + onCloud_storage_pinChanged: {spyCatcher.spy6 = true } + onCloud_timeoutChanged: {spyCatcher.spy7 = true } + onCloud_verification_statusChanged: {spyCatcher.spy8 = true } + onSave_password_localChanged: {spyCatcher.spy9 = true } + onSave_userid_localChanged: {spyCatcher.spy10 = true } + onUseridChanged: {spyCatcher.spy11 = true } + } + } + + function test_signals() { + PrefCloudStorage.cloud_base_url = "qml" + PrefCloudStorage.cloud_storage_email = "qml" + PrefCloudStorage.cloud_storage_email_encoded = "qml" + PrefCloudStorage.cloud_storage_password = "qml" + PrefCloudStorage.cloud_storage_pin = "qml" + PrefCloudStorage.cloud_timeout = 18 + PrefCloudStorage.cloud_verification_status = 2 + PrefCloudStorage.save_password_local = ! PrefCloudStorage.save_password_local + PrefCloudStorage.save_userid_local = ! PrefCloudStorage.save_userid_local + PrefCloudStorage.userid = "qml" + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + compare(spyCatcher.spy6, true) + compare(spyCatcher.spy7, true) + compare(spyCatcher.spy8, true) + compare(spyCatcher.spy9, true) + compare(spyCatcher.spy10, true) + compare(spyCatcher.spy11, true) + } } diff --git a/tests/tst_qPrefDisplay.qml b/tests/tst_qPrefDisplay.qml index f98aadf33..80107a7fb 100644 --- a/tests/tst_qPrefDisplay.qml +++ b/tests/tst_qPrefDisplay.qml @@ -29,8 +29,8 @@ TestCase { compare(PrefDisplay.PrefDisplay_invalid_dives, !x4) var x5 = PrefDisplay.show_developer - PrefDisplay.show_developer = !x4 - compare(PrefDisplay.show_developer, !x4) + PrefDisplay.show_developer = !x5 + compare(PrefDisplay.show_developer, !x5) var x6 = PrefDisplay.theme PrefDisplay.theme = "myColor" @@ -76,4 +76,57 @@ TestCase { PrefDisplay.lastState = 17 compare(PrefDisplay.lastState, 17) } + + Item { + id: spyCatcher + + property bool spy1 : false + // no signals 2,3 + property bool spy4 : false + property bool spy5 : false + property bool spy6 : false + // no signals 7 + property bool spy8 : false + property bool spy9 : false + // no signals 10,11,12 + property bool spy13 : false + // no signals 14,15 + property bool spy16 : false + + Connections { + target: PrefDisplay + onAnimation_speedChanged: {spyCatcher.spy1 = true } + onDisplay_invalid_divesChanged: {spyCatcher.spy4 = true } + onShow_developerChanged: {spyCatcher.spy5 = true } + onThemeChanged: {spyCatcher.spy6 = true } + onLastDirChanged: {spyCatcher.spy8 = true } + onUserSurveyChanged: {spyCatcher.spy9 = true } + onMaximizedChanged: {spyCatcher.spy13 = true } + onLastStateChanged: {spyCatcher.spy16 = true } + } + } + + function test_signals() { + PrefDisplay.animation_speed = -1157 + // 2,3 have no signal + PrefDisplay.display_invalid_dives = ! PrefDisplay.display_invalid_dives + PrefDisplay.show_developer = ! PrefDisplay.show_developer + PrefDisplay.theme = "qml" + // 7 has no signal + PrefDisplay.lastDir = "qml" + PrefDisplay.userSurvey = "qml" + // 10, 11, 12 have no signal + PrefDisplay.maximized = ! PrefDisplay.maximized + // 14,15 have no signal + PrefDisplay.lastState = -17 + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + compare(spyCatcher.spy6, true) + compare(spyCatcher.spy8, true) + compare(spyCatcher.spy9, true) + compare(spyCatcher.spy13, true) + compare(spyCatcher.spy16, true) + } } diff --git a/tests/tst_qPrefDiveComputer.qml b/tests/tst_qPrefDiveComputer.qml index 46ab96a2f..55554b2df 100644 --- a/tests/tst_qPrefDiveComputer.qml +++ b/tests/tst_qPrefDiveComputer.qml @@ -26,5 +26,38 @@ TestCase { PrefDiveComputer.vendor = "my vendor" compare(PrefDiveComputer.vendor, "my vendor") } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + property bool spy4 : false + property bool spy5 : false + + Connections { + target: PrefDiveComputer + onDeviceChanged: {spyCatcher.spy1 = true } + onDevice_nameChanged: {spyCatcher.spy2 = true } + onDownload_modeChanged: {spyCatcher.spy3 = true } + onProductChanged: {spyCatcher.spy4 = true } + onVendorChanged: {spyCatcher.spy5 = true } + } + } + + function test_signals() { + PrefDiveComputer.device = "qml" + PrefDiveComputer.device_name = "qml" + PrefDiveComputer.download_mode = -19 + PrefDiveComputer.product = "qml" + PrefDiveComputer.vendor = "qml" + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + } } diff --git a/tests/tst_qPrefDivePlanner.qml b/tests/tst_qPrefDivePlanner.qml index 7e0b70cbc..6852e5e39 100644 --- a/tests/tst_qPrefDivePlanner.qml +++ b/tests/tst_qPrefDivePlanner.qml @@ -107,4 +107,112 @@ TestCase { PrefDivePlanner.verbatim_plan = true compare(PrefDivePlanner.verbatim_plan, true) } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + property bool spy4 : false + property bool spy6 : false + property bool spy7 : false + property bool spy8 : false + property bool spy9 : false + property bool spy10 : false + property bool spy11 : false + property bool spy12 : false + property bool spy13 : false + property bool spy14 : false + property bool spy15 : false + property bool spy16 : false + property bool spy17 : false + property bool spy18 : false + property bool spy19 : false + property bool spy20 : false + property bool spy21 : false + property bool spy22 : false + property bool spy23 : false + property bool spy24 : false + property bool spy25 : false + + Connections { + target: PrefDivePlanner + onAscratelast6mChanged: {spyCatcher.spy1 = true } + onAscratestopsChanged: {spyCatcher.spy2 = true } + onAscrate50Changed: {spyCatcher.spy3 = true } + onAscrate75Changed: {spyCatcher.spy4 = true } + onBottompo2Changed: {spyCatcher.spy6 = true } + onBottomsacChanged: {spyCatcher.spy7 = true } + onDecopo2Changed: {spyCatcher.spy8 = true } + onDecosacChanged: {spyCatcher.spy9 = true } + onDescrateChanged: {spyCatcher.spy10 = true } + onDisplay_durationChanged: {spyCatcher.spy11 = true } + onDisplay_runtimeChanged: {spyCatcher.spy12 = true } + onDisplay_transitionsChanged: {spyCatcher.spy13 = true } + onDisplay_variationsChanged: {spyCatcher.spy14 = true } + onDoo2breaksChanged: {spyCatcher.spy15 = true } + onDrop_stone_modeChanged: {spyCatcher.spy16 = true } + onLast_stopChanged: {spyCatcher.spy17 = true } + onMin_switch_durationChanged: {spyCatcher.spy18 = true } + onProblemsolvingtimeChanged: {spyCatcher.spy20 = true } + onReserve_gasChanged: {spyCatcher.spy21 = true } + onSacfactorChanged: {spyCatcher.spy22 = true } + onSafetystopChanged: {spyCatcher.spy23 = true } + onSwitch_at_req_stopChanged: {spyCatcher.spy24 = true } + onVerbatim_planChanged: {spyCatcher.spy25 = true } + } + } + + function test_signals() { + PrefDivePlanner.ascratelast6m = -11 + PrefDivePlanner.ascratestops = -11 + PrefDivePlanner.ascrate50 = -12 + PrefDivePlanner.ascrate75 = -13 + // 5 not emitting signals + PrefDivePlanner.bottompo2 = -14 + PrefDivePlanner.bottomsac = -15 + PrefDivePlanner.decopo2 = -16 + PrefDivePlanner.decosac = -17 + PrefDivePlanner.descrate = -18 + PrefDivePlanner.display_duration = ! PrefDivePlanner.display_duration + PrefDivePlanner.display_runtime = ! PrefDivePlanner.display_runtime + PrefDivePlanner.display_transitions = ! PrefDivePlanner.display_transitions + PrefDivePlanner.display_variations = ! PrefDivePlanner.display_variations + PrefDivePlanner.doo2breaks = ! PrefDivePlanner.doo2breaks + PrefDivePlanner.drop_stone_mode = ! PrefDivePlanner.drop_stone_mode + PrefDivePlanner.last_stop = ! PrefDivePlanner.last_stop + PrefDivePlanner.min_switch_duration = -19 + // 19 not emitting signals + PrefDivePlanner.problemsolvingtime = -20 + PrefDivePlanner.reserve_gas = -21 + PrefDivePlanner.sacfactor = -22 + PrefDivePlanner.safetystop = ! PrefDivePlanner.safetystop + PrefDivePlanner.switch_at_req_stop = ! PrefDivePlanner.switch_at_req_stop + PrefDivePlanner.verbatim_plan = ! PrefDivePlanner.verbatim_plan + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy6, true) + compare(spyCatcher.spy7, true) + compare(spyCatcher.spy8, true) + compare(spyCatcher.spy9, true) + compare(spyCatcher.spy10, true) + compare(spyCatcher.spy11, true) + compare(spyCatcher.spy12, true) + compare(spyCatcher.spy13, true) + compare(spyCatcher.spy14, true) + compare(spyCatcher.spy15, true) + compare(spyCatcher.spy16, true) + compare(spyCatcher.spy17, true) + compare(spyCatcher.spy18, true) + compare(spyCatcher.spy20, true) + compare(spyCatcher.spy21, true) + compare(spyCatcher.spy22, true) + compare(spyCatcher.spy23, true) + compare(spyCatcher.spy24, true) + compare(spyCatcher.spy25, true) + } } diff --git a/tests/tst_qPrefFacebook.qml b/tests/tst_qPrefFacebook.qml index 721179772..24be306a7 100644 --- a/tests/tst_qPrefFacebook.qml +++ b/tests/tst_qPrefFacebook.qml @@ -18,4 +18,29 @@ TestCase { PrefFacebook.user_id = "my user" compare(PrefFacebook.user_id, "my user") } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + + Connections { + target: PrefFacebook + onAccess_tokenChanged: {spyCatcher.spy1 = true } + onAlbum_idChanged: {spyCatcher.spy2 = true } + onUser_idChanged: {spyCatcher.spy3 = true } + } + } + + function test_signals() { + PrefFacebook.access_token = "qml" + PrefFacebook.album_id = "qml" + PrefFacebook.user_id = "qml" + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + } } diff --git a/tests/tst_qPrefGeneral.qml b/tests/tst_qPrefGeneral.qml index c78ada6e9..249603b03 100644 --- a/tests/tst_qPrefGeneral.qml +++ b/tests/tst_qPrefGeneral.qml @@ -58,4 +58,66 @@ TestCase { PrefGeneral.diveshareExport_private = true compare(PrefGeneral.diveshareExport_private, true) } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + property bool spy5 : false + property bool spy6 : false + property bool spy7 : false + property bool spy8 : false + property bool spy9 : false + property bool spy10 : false + property bool spy11 : false + property bool spy12 : false + property bool spy13 : false + + Connections { + target: PrefGeneral + onAuto_recalculate_thumbnailsChanged: {spyCatcher.spy1 = true } + onDefault_cylinderChanged: {spyCatcher.spy2 = true } + onDefault_filenameChanged: {spyCatcher.spy3 = true } + onDefaultsetpointChanged: {spyCatcher.spy5 = true } + onExtract_video_thumbnailsChanged: {spyCatcher.spy6 = true } + onExtract_video_thumbnails_positionChanged: {spyCatcher.spy7 = true } + onFfmpeg_executableChanged: {spyCatcher.spy8 = true } + onO2consumptionChanged: {spyCatcher.spy9 = true } + onPscr_ratioChanged: {spyCatcher.spy10 = true } + onUse_default_fileChanged: {spyCatcher.spy11 = true } + onDiveshareExport_uidChanged: {spyCatcher.spy12 = true } + onDiveshareExport_privateChanged: {spyCatcher.spy13 = true } + } + } + + function test_signals() { + PrefGeneral.auto_recalculate_thumbnails = ! PrefGeneral.auto_recalculate_thumbnails + PrefGeneral.default_cylinder = "qml" + PrefGeneral.default_filename = "qml" + // 4 is not emitting signals + PrefGeneral.defaultsetpoint = -17 + PrefGeneral.extract_video_thumbnails = ! PrefGeneral.extract_video_thumbnails + PrefGeneral.extract_video_thumbnails_position = -17 + PrefGeneral.ffmpeg_executable = "qml" + PrefGeneral.o2consumption = -17 + PrefGeneral.pscr_ratio = -17 + PrefGeneral.use_default_file = ! PrefGeneral.use_default_file + PrefGeneral.diveshareExport_uid = "qml" + PrefGeneral.diveshareExport_private = ! PrefGeneral.diveshareExport_private + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy5, true) + compare(spyCatcher.spy6, true) + compare(spyCatcher.spy7, true) + compare(spyCatcher.spy8, true) + compare(spyCatcher.spy9, true) + compare(spyCatcher.spy10, true) + compare(spyCatcher.spy11, true) + compare(spyCatcher.spy12, true) + compare(spyCatcher.spy13, true) + } } diff --git a/tests/tst_qPrefGeocoding.qml b/tests/tst_qPrefGeocoding.qml index f28eaba28..01e2335c8 100644 --- a/tests/tst_qPrefGeocoding.qml +++ b/tests/tst_qPrefGeocoding.qml @@ -18,4 +18,27 @@ TestCase { //TBD PrefGeocoding.third_taxonomy_category = ?? //TBD compare(PrefGeocoding.third_taxonom_categroy, ??) } + + Item { + id: spyCatcher + +//TBD property bool spy1 : false +//TBD property bool spy2 : false +//TBD property bool spy3 : false + + Connections { + target: PrefGeocoding +//TBD onChanged: {spyCatcher.spy1 = true } + } + } + + function test_signals() { +//TBD PrefGeocoding.first_taxonomy_category = ?? +//TBD PrefGeocoding.second_taxonomy_category = ?? +//TBD PrefGeocoding.third_taxonomy_category = ?? + +//TBD compare(spyCatcher.spy1, true) +//TBD compare(spyCatcher.spy2, true) +//TBD compare(spyCatcher.spy3, true) + } } diff --git a/tests/tst_qPrefLanguage.qml b/tests/tst_qPrefLanguage.qml index 023f6c5cd..efd8d2667 100644 --- a/tests/tst_qPrefLanguage.qml +++ b/tests/tst_qPrefLanguage.qml @@ -37,4 +37,49 @@ TestCase { PrefLanguage.use_system_language = true compare(PrefLanguage.use_system_language, true) } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + property bool spy4 : false + property bool spy5 : false + property bool spy6 : false + property bool spy7 : false + property bool spy8 : false + + Connections { + target: PrefLanguage + onDate_formatChanged: {spyCatcher.spy1 = true } + onDate_format_overrideChanged: {spyCatcher.spy2 = true } + onDate_format_shortChanged: {spyCatcher.spy3 = true } + onLanguageChanged: {spyCatcher.spy4 = true } + onLang_localeChanged: {spyCatcher.spy5 = true } + onTime_formatChanged: {spyCatcher.spy6 = true } + onTime_format_overrideChanged: {spyCatcher.spy7 = true } + onUse_system_languageChanged: {spyCatcher.spy8 = true } + } + } + + function test_signals() { + PrefLanguage.date_format = "qml" + PrefLanguage.date_format_override = ! PrefLanguage.date_format_override + PrefLanguage.date_format_short = "qml" + PrefLanguage.language = "qml" + PrefLanguage.lang_locale = "qml" + PrefLanguage.time_format = "qml" + PrefLanguage.time_format_override = ! PrefLanguage.time_format_override + PrefLanguage.use_system_language = ! PrefLanguage.use_system_language + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + compare(spyCatcher.spy6, true) + compare(spyCatcher.spy7, true) + compare(spyCatcher.spy8, true) + } } diff --git a/tests/tst_qPrefLocationService.qml b/tests/tst_qPrefLocationService.qml index 61cbc9827..9da5fcfb3 100644 --- a/tests/tst_qPrefLocationService.qml +++ b/tests/tst_qPrefLocationService.qml @@ -14,4 +14,25 @@ TestCase { PrefLocationService.time_threshold = 12 compare(PrefLocationService.time_threshold , 12) } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + + Connections { + target: PrefLocationService + onDistance_thresholdChanged: {spyCatcher.spy1 = true } + onTime_thresholdChanged: {spyCatcher.spy2 = true } + } + } + + function test_signals() { + PrefLocationService.distance_threshold = -123 + PrefLocationService.time_threshold = -12 + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + } } diff --git a/tests/tst_qPrefPartialPressureGas.qml b/tests/tst_qPrefPartialPressureGas.qml index 5000a3dae..e927fdfc2 100644 --- a/tests/tst_qPrefPartialPressureGas.qml +++ b/tests/tst_qPrefPartialPressureGas.qml @@ -34,4 +34,45 @@ TestCase { PrefPartialPressureGas.po2_threshold_min = 21.5 compare(PrefPartialPressureGas.po2_threshold_min, 21.5) } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + property bool spy4 : false + property bool spy5 : false + property bool spy6 : false + property bool spy7 : false + + Connections { + target: PrefPartialPressureGas + onPheChanged: {spyCatcher.spy1 = true } + onPhe_thresholdChanged: {spyCatcher.spy2 = true } + onPn2Changed: {spyCatcher.spy3 = true } + onPn2_thresholdChanged: {spyCatcher.spy4 = true } + onPo2Changed: {spyCatcher.spy5 = true } + onPo2_threshold_maxChanged: {spyCatcher.spy6 = true } + onPo2_threshold_minChanged: {spyCatcher.spy7 = true } + } + } + + function test_signals() { + PrefPartialPressureGas.phe = ! PrefPartialPressureGas.phe + PrefPartialPressureGas.phe_threshold = -21.2 + PrefPartialPressureGas.pn2 = ! PrefPartialPressureGas.pn2 + PrefPartialPressureGas.pn2_threshold = -21.3 + PrefPartialPressureGas.po2 = ! PrefPartialPressureGas.po2 + PrefPartialPressureGas.po2_threshold_max = -21.4 + PrefPartialPressureGas.po2_threshold_min = -21.5 + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + compare(spyCatcher.spy6, true) + compare(spyCatcher.spy7, true) + } } diff --git a/tests/tst_qPrefProxy.qml b/tests/tst_qPrefProxy.qml index a51a03881..55d814a15 100644 --- a/tests/tst_qPrefProxy.qml +++ b/tests/tst_qPrefProxy.qml @@ -30,4 +30,41 @@ TestCase { PrefProxy.proxy_user = "my user" compare(PrefProxy.proxy_user, "my user") } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + property bool spy4 : false + property bool spy5 : false + property bool spy6 : false + + Connections { + target: PrefProxy + onProxy_authChanged: {spyCatcher.spy1 = true } + onProxy_hostChanged: {spyCatcher.spy2 = true } + onProxy_passChanged: {spyCatcher.spy3 = true } + onProxy_portChanged: {spyCatcher.spy4 = true } + onProxy_typeChanged: {spyCatcher.spy5 = true } + onProxy_userChanged: {spyCatcher.spy6 = true } + } + } + + function test_signals() { + PrefProxy.proxy_auth = ! PrefProxy.proxy_auth + PrefProxy.proxy_host = "qml" + PrefProxy.proxy_pass = "qml" + PrefProxy.proxy_port = -544 + PrefProxy.proxy_type = -3 + PrefProxy.proxy_user = "qml" + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + compare(spyCatcher.spy6, true) + } } diff --git a/tests/tst_qPrefTechnicalDetails.qml b/tests/tst_qPrefTechnicalDetails.qml index 8dfd1719b..33b4eacd5 100644 --- a/tests/tst_qPrefTechnicalDetails.qml +++ b/tests/tst_qPrefTechnicalDetails.qml @@ -114,4 +114,123 @@ TestCase { PrefTechnicalDetails.zoomed_plot = true compare(PrefTechnicalDetails.zoomed_plot, true) } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + property bool spy4 : false + property bool spy5 : false + property bool spy7 : false + property bool spy8 : false + property bool spy9 : false + property bool spy10 : false + property bool spy11 : false + property bool spy12 : false + property bool spy13 : false + property bool spy14 : false + property bool spy15 : false + property bool spy16 : false + property bool spy17 : false + property bool spy18 : false + property bool spy19 : false + property bool spy20 : false + property bool spy21 : false + property bool spy22 : false + property bool spy23 : false + property bool spy24 : false + property bool spy25 : false + property bool spy26 : false + property bool spy27 : false + + Connections { + target: PrefTechnicalDetails + onCalcalltissuesChanged: {spyCatcher.spy1 = true } + onCalcceilingChanged: {spyCatcher.spy2 = true } + onCalcceiling3mChanged: {spyCatcher.spy3 = true } + onCalcndlttsChanged: {spyCatcher.spy4 = true } + onDcceilingChanged: {spyCatcher.spy5 = true } + onDisplay_unused_tanksChanged: {spyCatcher.spy7 = true } + onEadChanged: {spyCatcher.spy8 = true } + onGfhighChanged: {spyCatcher.spy9 = true } + onGflowChanged: {spyCatcher.spy10 = true } + onGf_low_at_maxdepthChanged: {spyCatcher.spy11 = true } + onHrgraphChanged: {spyCatcher.spy12 = true } + onModChanged: {spyCatcher.spy13 = true } + onModpO2Changed: {spyCatcher.spy14 = true } + onPercentagegraphChanged: {spyCatcher.spy15 = true } + onRedceilingChanged: {spyCatcher.spy16 = true } + onRulergraphChanged: {spyCatcher.spy17 = true } + onShow_average_depthChanged: {spyCatcher.spy18 = true } + onShow_ccr_sensorsChanged: {spyCatcher.spy19 = true } + onShow_ccr_setpointChanged: {spyCatcher.spy20 = true } + onShow_icdChanged: {spyCatcher.spy21 = true } + onShow_pictures_in_profileChanged: {spyCatcher.spy22 = true } + onShow_sacChanged: {spyCatcher.spy23 = true } + onShow_scr_ocpo2Changed: {spyCatcher.spy24 = true } + onTankbarChanged: {spyCatcher.spy25 = true } + onVpmb_conservatismChanged: {spyCatcher.spy26 = true } + onZoomed_plotChanged: {spyCatcher.spy27 = true } + } + } + + function test_signals() { + PrefTechnicalDetails.calcalltissues = ! PrefTechnicalDetails.calcalltissues + PrefTechnicalDetails.calcceiling = ! PrefTechnicalDetails.calcceiling + PrefTechnicalDetails.calcceiling3m = ! PrefTechnicalDetails.calcceiling3m + PrefTechnicalDetails.calcndltts = ! PrefTechnicalDetails.calcndltts + PrefTechnicalDetails.dcceiling = ! PrefTechnicalDetails.dcceiling + // 6 does not emit signal + PrefTechnicalDetails.display_unused_tanks = ! PrefTechnicalDetails.display_unused_tanks + PrefTechnicalDetails.ead = ! PrefTechnicalDetails.ead + PrefTechnicalDetails.gfhigh = -27 + PrefTechnicalDetails.gflow = -25 + PrefTechnicalDetails.gf_low_at_maxdepth = ! PrefTechnicalDetails.gf_low_at_maxdepth + PrefTechnicalDetails.hrgraph = ! PrefTechnicalDetails.hrgraph + PrefTechnicalDetails.mod = ! PrefTechnicalDetails.mod + PrefTechnicalDetails.modpO2 = -1.02 + PrefTechnicalDetails.percentagegraph = ! PrefTechnicalDetails.percentagegraph + PrefTechnicalDetails.redceiling = ! PrefTechnicalDetails.redceiling + PrefTechnicalDetails.rulergraph = ! PrefTechnicalDetails.rulergraph + PrefTechnicalDetails.show_average_depth = ! PrefTechnicalDetails.show_average_depth + PrefTechnicalDetails.show_ccr_sensors = ! PrefTechnicalDetails.show_ccr_sensors + PrefTechnicalDetails.show_ccr_setpoint = ! PrefTechnicalDetails.show_ccr_setpoint + PrefTechnicalDetails.show_icd = ! PrefTechnicalDetails.show_icd + PrefTechnicalDetails.show_pictures_in_profile = ! PrefTechnicalDetails.show_pictures_in_profile + PrefTechnicalDetails.show_sac = ! PrefTechnicalDetails.show_sac + PrefTechnicalDetails.show_scr_ocpo2 = ! PrefTechnicalDetails.show_scr_ocpo2 + PrefTechnicalDetails.tankbar = ! PrefTechnicalDetails.tankbar + PrefTechnicalDetails.vpmb_conservatism = -127 + PrefTechnicalDetails.zoomed_plot = ! PrefTechnicalDetails.zoomed_plot + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + compare(spyCatcher.spy7, true) + compare(spyCatcher.spy8, true) + compare(spyCatcher.spy9, true) + compare(spyCatcher.spy10, true) + compare(spyCatcher.spy11, true) + compare(spyCatcher.spy12, true) + compare(spyCatcher.spy13, true) + compare(spyCatcher.spy14, true) + compare(spyCatcher.spy15, true) + compare(spyCatcher.spy16, true) + compare(spyCatcher.spy17, true) + compare(spyCatcher.spy18, true) + compare(spyCatcher.spy19, true) + compare(spyCatcher.spy20, true) + compare(spyCatcher.spy21, true) + compare(spyCatcher.spy22, true) + compare(spyCatcher.spy23, true) + compare(spyCatcher.spy24, true) + compare(spyCatcher.spy25, true) + compare(spyCatcher.spy26, true) + compare(spyCatcher.spy27, true) + } } diff --git a/tests/tst_qPrefUnits.qml b/tests/tst_qPrefUnits.qml index 22ae14a19..88bee3076 100644 --- a/tests/tst_qPrefUnits.qml +++ b/tests/tst_qPrefUnits.qml @@ -46,4 +46,29 @@ TestCase { //TBD PrefUnits.weight = ?? //TBD compare(PrefUnits.weight, ??) } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy5 : false + property bool spy7 : false + + Connections { + target: PrefUnits + onCoordinates_traditionalChanged: {spyCatcher.spy1 = true } + onShow_units_tableChanged: {spyCatcher.spy5 = true } + onUnit_systemChanged: {spyCatcher.spy7 = true } + } + } + + function test_signals() { + PrefUnits.coordinates_traditional = ! PrefUnits.coordinates_traditional + PrefUnits.show_units_table = ! PrefUnits.show_units_table + PrefUnits.unit_system = "qml" + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy5, true) + compare(spyCatcher.spy7, true) + } } diff --git a/tests/tst_qPrefUpdateManager.qml b/tests/tst_qPrefUpdateManager.qml index 4772ada62..18bd577fd 100644 --- a/tests/tst_qPrefUpdateManager.qml +++ b/tests/tst_qPrefUpdateManager.qml @@ -7,7 +7,7 @@ TestCase { function test_variables() { var x1 = PrefUpdateManager.dont_check_for_updates - PrefUpdateManager.dont_check_for_updates = true; + PrefUpdateManager.dont_check_for_updates = true compare(PrefUpdateManager.dont_check_for_updates, true) var x2 = PrefUpdateManager.dont_check_exists @@ -27,4 +27,38 @@ TestCase { PrefUpdateManager.uuidString = "jan again" compare(PrefUpdateManager.uuidString, "jan again") } + + Item { + id: spyCatcher + + property bool spy1 : false + property bool spy2 : false + property bool spy3 : false + property bool spy4 : false + property bool spy5 : false + + Connections { + target: PrefUpdateManager + onDont_check_for_updatesChanged: {spyCatcher.spy1 = true } + onDont_check_existsChanged: {spyCatcher.spy2 = true } + onLast_version_usedChanged: {spyCatcher.spy3 = true } + onNext_checkChanged: {spyCatcher.spy4 = true } + onUuidStringChanged: {spyCatcher.spy5 = true } + } + } + + function test_signals() { + PrefUpdateManager.dont_check_for_updates = ! PrefUpdateManager.dont_check_for_updates + PrefUpdateManager.dont_check_exists = ! PrefUpdateManager.dont_check_exists + PrefUpdateManager.last_version_used = "qml" + var x4_date = Date.fromLocaleString(Qt.locale(), "01-01-2010", "dd-MM-yyyy") + PrefUpdateManager.next_check = x4_date + PrefUpdateManager.uuidString = "qml" + + compare(spyCatcher.spy1, true) + compare(spyCatcher.spy2, true) + compare(spyCatcher.spy3, true) + compare(spyCatcher.spy4, true) + compare(spyCatcher.spy5, true) + } } |