summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-09-02 09:13:04 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-07 14:37:18 -0700
commita93ecf3912bcd78930487b0e05f41ebd5c6e7ed4 (patch)
tree71e64c5d6ff705989ea68c7d3823752eb5100476 /tests
parentee6b5643b5581ec3fda3873543f9275235ae0598 (diff)
downloadsubsurface-a93ecf3912bcd78930487b0e05f41ebd5c6e7ed4.tar.gz
tests: update qPref* to the shadow variable
The shadow variable causes properties only to be saved when actual changed, therefore some test cases need update Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/testqPrefDisplay.cpp10
-rw-r--r--tests/testqPrefDivePlanner.cpp60
-rw-r--r--tests/testqPrefTechnicalDetails.cpp66
-rw-r--r--tests/testqPrefUnits.cpp6
4 files changed, 71 insertions, 71 deletions
diff --git a/tests/testqPrefDisplay.cpp b/tests/testqPrefDisplay.cpp
index ce4d627ed..9347e252f 100644
--- a/tests/testqPrefDisplay.cpp
+++ b/tests/testqPrefDisplay.cpp
@@ -41,7 +41,7 @@ void TestQPrefDisplay::test_set_struct()
auto display = qPrefDisplay::instance();
display->set_animation_speed(27);
- display->set_display_invalid_dives(true);
+ display->set_display_invalid_dives(false);
display->set_divelist_font("doNotCareAtAll");
display->set_font_size(12.0);
display->set_show_developer(false);
@@ -58,7 +58,7 @@ void TestQPrefDisplay::test_set_struct()
display->set_lastState(17);
QCOMPARE(prefs.animation_speed, 27);
- QCOMPARE(prefs.display_invalid_dives, true);
+ QCOMPARE(prefs.display_invalid_dives, false);
QCOMPARE(prefs.divelist_font, "doNotCareAtAll");
QCOMPARE(prefs.font_size, 12.0);
QCOMPARE(prefs.show_developer, false);
@@ -82,7 +82,7 @@ void TestQPrefDisplay::test_set_load_struct()
auto display = qPrefDisplay::instance();
display->set_animation_speed(33);
- display->set_display_invalid_dives(false);
+ display->set_display_invalid_dives(true);
display->set_divelist_font("doNotCareString");
display->set_font_size(15.0);
display->set_show_developer(true);
@@ -99,14 +99,14 @@ void TestQPrefDisplay::test_set_load_struct()
display->set_lastState(27);
prefs.animation_speed = 17;
- prefs.display_invalid_dives = true;
+ prefs.display_invalid_dives = false;
prefs.divelist_font = copy_qstring("doNotCareAtAll");
prefs.font_size = 12.0;
prefs.show_developer = false;
display->load();
QCOMPARE(prefs.animation_speed, 33);
- QCOMPARE(prefs.display_invalid_dives, false);
+ QCOMPARE(prefs.display_invalid_dives, true);
QCOMPARE(prefs.divelist_font, "doNotCareString");
QCOMPARE(prefs.font_size, 15.0);
QCOMPARE(prefs.show_developer, true);
diff --git a/tests/testqPrefDivePlanner.cpp b/tests/testqPrefDivePlanner.cpp
index 173bc1d96..a33033766 100644
--- a/tests/testqPrefDivePlanner.cpp
+++ b/tests/testqPrefDivePlanner.cpp
@@ -152,21 +152,21 @@ void TestQPrefDivePlanner::test_set_load_struct()
tst->set_decopo2(26);
tst->set_decosac(27);
tst->set_descrate(28);
- tst->set_display_duration(false);
- tst->set_display_runtime(false);
- tst->set_display_transitions(false);
- tst->set_display_variations(false);
- tst->set_doo2breaks(false);
- tst->set_drop_stone_mode(false);
- tst->set_last_stop(false);
+ tst->set_display_duration(true);
+ tst->set_display_runtime(true);
+ tst->set_display_transitions(true);
+ tst->set_display_variations(true);
+ tst->set_doo2breaks(true);
+ tst->set_drop_stone_mode(true);
+ tst->set_last_stop(true);
tst->set_min_switch_duration(29);
tst->set_planner_deco_mode(VPMB);
tst->set_problemsolvingtime(30);
tst->set_reserve_gas(31);
tst->set_sacfactor(32);
- tst->set_safetystop(false);
- tst->set_switch_at_req_stop(false);
- tst->set_verbatim_plan(false);
+ tst->set_safetystop(true);
+ tst->set_switch_at_req_stop(true);
+ tst->set_verbatim_plan(true);
prefs.ascratelast6m = 10;
prefs.ascratestops = 11;
@@ -178,21 +178,21 @@ void TestQPrefDivePlanner::test_set_load_struct()
prefs.decopo2 = 16;
prefs.decosac = 17;
prefs.descrate = 18;
- prefs.display_duration = true;
- prefs.display_runtime = true;
- prefs.display_transitions = true;
- prefs.display_variations = true;
- prefs.doo2breaks = true;
- prefs.drop_stone_mode = true;
- prefs.last_stop = true;
+ prefs.display_duration = false;
+ prefs.display_runtime = false;
+ prefs.display_transitions = false;
+ prefs.display_variations = false;
+ prefs.doo2breaks = false;
+ prefs.drop_stone_mode = false;
+ prefs.last_stop = false;
prefs.min_switch_duration = 19;
prefs.planner_deco_mode = BUEHLMANN;
prefs.problemsolvingtime = 20;
prefs.reserve_gas = 21;
prefs.sacfactor = 22;
- prefs.safetystop = true;
- prefs.switch_at_req_stop = true;
- prefs.verbatim_plan = true;
+ prefs.safetystop = false;
+ prefs.switch_at_req_stop = false;
+ prefs.verbatim_plan = false;
tst->load();
QCOMPARE(prefs.ascratelast6m, 20);
@@ -205,21 +205,21 @@ void TestQPrefDivePlanner::test_set_load_struct()
QCOMPARE(prefs.decopo2, 26);
QCOMPARE(prefs.decosac, 27);
QCOMPARE(prefs.descrate, 28);
- QCOMPARE(prefs.display_duration, false);
- QCOMPARE(prefs.display_runtime, false);
- QCOMPARE(prefs.display_transitions, false);
- QCOMPARE(prefs.display_variations, false);
- QCOMPARE(prefs.doo2breaks, false);
- QCOMPARE(prefs.drop_stone_mode, false);
- QCOMPARE(prefs.last_stop, false);
+ QCOMPARE(prefs.display_duration, true);
+ QCOMPARE(prefs.display_runtime, true);
+ QCOMPARE(prefs.display_transitions, true);
+ QCOMPARE(prefs.display_variations, true);
+ QCOMPARE(prefs.doo2breaks, true);
+ QCOMPARE(prefs.drop_stone_mode, true);
+ QCOMPARE(prefs.last_stop, true);
QCOMPARE(prefs.min_switch_duration, 29);
QCOMPARE(prefs.planner_deco_mode, VPMB);
QCOMPARE(prefs.problemsolvingtime, 30);
QCOMPARE(prefs.reserve_gas, 31);
QCOMPARE(prefs.sacfactor, 32);
- QCOMPARE(prefs.safetystop, false);
- QCOMPARE(prefs.switch_at_req_stop, false);
- QCOMPARE(prefs.verbatim_plan, false);
+ QCOMPARE(prefs.safetystop, true);
+ QCOMPARE(prefs.switch_at_req_stop, true);
+ QCOMPARE(prefs.verbatim_plan, true);
}
void TestQPrefDivePlanner::test_struct_disk()
diff --git a/tests/testqPrefTechnicalDetails.cpp b/tests/testqPrefTechnicalDetails.cpp
index b3abd8500..5f3fb4477 100644
--- a/tests/testqPrefTechnicalDetails.cpp
+++ b/tests/testqPrefTechnicalDetails.cpp
@@ -148,85 +148,85 @@ void TestQPrefTechnicalDetails::test_set_load_struct()
tst->set_calcceiling(false);
tst->set_calcceiling3m(false);
tst->set_calcndltts(false);
- tst->set_dcceiling(false);
+ tst->set_dcceiling(true);
tst->set_display_deco_mode(RECREATIONAL);
tst->set_display_unused_tanks(false);
tst->set_ead(false);
tst->set_gfhigh(29);
tst->set_gflow(24);
- tst->set_gf_low_at_maxdepth(false);
+ tst->set_gf_low_at_maxdepth(true);
tst->set_hrgraph(false);
tst->set_mod(false);
tst->set_modpO2(1.12);
tst->set_percentagegraph(false);
tst->set_redceiling(false);
tst->set_rulergraph(false);
- tst->set_show_average_depth(false);
- tst->set_show_ccr_sensors(false);
- tst->set_show_ccr_setpoint(false);
- tst->set_show_icd(false);
- tst->set_show_pictures_in_profile(false);
- tst->set_show_sac(false);
- tst->set_show_scr_ocpo2(false);
- tst->set_tankbar(false);
+ tst->set_show_average_depth(true);
+ tst->set_show_ccr_sensors(true);
+ tst->set_show_ccr_setpoint(true);
+ tst->set_show_icd(true);
+ tst->set_show_pictures_in_profile(true);
+ tst->set_show_sac(true);
+ tst->set_show_scr_ocpo2(true);
+ tst->set_tankbar(true);
tst->set_vpmb_conservatism(64);
- tst->set_zoomed_plot(false);
+ tst->set_zoomed_plot(true);
prefs.calcalltissues = true;
prefs.calcceiling = true;
prefs.calcceiling3m = true;
prefs.calcndltts = true;
- prefs.dcceiling = true;
+ prefs.dcceiling = false;
prefs.display_deco_mode = BUEHLMANN;
prefs.display_unused_tanks = true;
prefs.ead = true;
prefs.gfhigh = 27;
prefs.gflow = 25;
- prefs.gf_low_at_maxdepth = true;
+ prefs.gf_low_at_maxdepth = false;
prefs.hrgraph = true;
prefs.mod = true;
prefs.modpO2 = 1.02;
prefs.percentagegraph = true;
prefs.redceiling = true;
prefs.rulergraph = true;
- prefs.show_average_depth = true;
- prefs.show_ccr_sensors = true;
- prefs.show_ccr_setpoint = true;
- prefs.show_icd = true;
- prefs.show_pictures_in_profile = true;
- prefs.show_sac = true;
- prefs.show_scr_ocpo2 = true;
- prefs.tankbar = true;
+ prefs.show_average_depth = false;
+ prefs.show_ccr_sensors = false;
+ prefs.show_ccr_setpoint = false;
+ prefs.show_icd = false;
+ prefs.show_pictures_in_profile = false;
+ prefs.show_sac = false;
+ prefs.show_scr_ocpo2 = false;
+ prefs.tankbar = false;
prefs.vpmb_conservatism = 123;
- prefs.zoomed_plot = true;
+ prefs.zoomed_plot = false;
tst->load();
QCOMPARE(prefs.calcceiling, false);
QCOMPARE(prefs.calcceiling3m, false);
QCOMPARE(prefs.calcndltts, false);
- QCOMPARE(prefs.dcceiling, false);
+ QCOMPARE(prefs.dcceiling, true);
QCOMPARE(prefs.display_deco_mode, RECREATIONAL);
QCOMPARE(prefs.display_unused_tanks, false);
QCOMPARE(prefs.ead, false);
QCOMPARE((int)prefs.gfhigh, 29);
QCOMPARE((int)prefs.gflow, 24);
- QCOMPARE(prefs.gf_low_at_maxdepth, false);
+ QCOMPARE(prefs.gf_low_at_maxdepth, true);
QCOMPARE(prefs.hrgraph, false);
QCOMPARE(prefs.mod, false);
QCOMPARE(prefs.modpO2, 1.12);
QCOMPARE(prefs.percentagegraph, false);
QCOMPARE(prefs.redceiling, false);
QCOMPARE(prefs.rulergraph, false);
- QCOMPARE(prefs.show_average_depth, false);
- QCOMPARE(prefs.show_ccr_sensors, false);
- QCOMPARE(prefs.show_ccr_setpoint, false);
- QCOMPARE(prefs.show_icd, false);
- QCOMPARE(prefs.show_pictures_in_profile, false);
- QCOMPARE(prefs.show_sac, false);
- QCOMPARE(prefs.show_scr_ocpo2, false);
- QCOMPARE(prefs.tankbar, false);
+ QCOMPARE(prefs.show_average_depth, true);
+ QCOMPARE(prefs.show_ccr_sensors, true);
+ QCOMPARE(prefs.show_ccr_setpoint, true);
+ QCOMPARE(prefs.show_icd, true);
+ QCOMPARE(prefs.show_pictures_in_profile, true);
+ QCOMPARE(prefs.show_sac, true);
+ QCOMPARE(prefs.show_scr_ocpo2, true);
+ QCOMPARE(prefs.tankbar, true);
QCOMPARE((int)prefs.vpmb_conservatism, 64);
- QCOMPARE(prefs.zoomed_plot, false);
+ QCOMPARE(prefs.zoomed_plot, true);
}
void TestQPrefTechnicalDetails::test_struct_disk()
diff --git a/tests/testqPrefUnits.cpp b/tests/testqPrefUnits.cpp
index 8d9178863..5291afa14 100644
--- a/tests/testqPrefUnits.cpp
+++ b/tests/testqPrefUnits.cpp
@@ -74,7 +74,7 @@ void TestQPrefUnits::test_set_load_struct()
auto tst = qPrefUnits::instance();
- tst->set_coordinates_traditional(false);
+ tst->set_coordinates_traditional(true);
tst->set_duration_units(units::MINUTES_ONLY);
tst->set_length(units::FEET);
tst->set_pressure(units::PSI);
@@ -85,7 +85,7 @@ void TestQPrefUnits::test_set_load_struct()
tst->set_weight(units::LBS);
tst->sync();
- prefs.coordinates_traditional = true;
+ prefs.coordinates_traditional = false;
prefs.units.duration_units = units::MIXED;
prefs.units.length = units::METERS;
prefs.units.pressure = units::BAR;
@@ -96,7 +96,7 @@ void TestQPrefUnits::test_set_load_struct()
prefs.units.weight = units::KG;
tst->load();
- QCOMPARE(prefs.coordinates_traditional, false);
+ QCOMPARE(prefs.coordinates_traditional, true);
QCOMPARE(prefs.units.duration_units, units::MINUTES_ONLY);
QCOMPARE(prefs.units.length, units::FEET);
QCOMPARE(prefs.units.pressure, units::PSI);