diff options
author | jan Iversen <jani@apache.org> | 2018-08-01 21:41:42 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2018-08-08 14:29:50 +0200 |
commit | 21243ec4f7e2b2d886ac550142afee4c0df65924 (patch) | |
tree | 684a092f482e478f2e586a996d4c967a0fe90779 /tests | |
parent | 357510b9cd1eec9fdd598ebd6103f62f30e29807 (diff) | |
download | subsurface-21243ec4f7e2b2d886ac550142afee4c0df65924.tar.gz |
core: activate qPrefDivePlanner
remove DivePlanner from SettingsObjectWrapper and reference qPrefDivePlanner
update files using SettingsObjectWrapper/DivePlanner to use qPrefDivePlanner
this activated qPrefDivePlanner and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testpreferences.cpp | 166 |
1 files changed, 85 insertions, 81 deletions
diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp index 50c8472d8..345aaf094 100644 --- a/tests/testpreferences.cpp +++ b/tests/testpreferences.cpp @@ -177,41 +177,44 @@ void TestPreferences::testPreferences() TEST(geo->secondTaxonomyCategory(), TC_COUNTRY); TEST(geo->thirdTaxonomyCategory(), TC_NONE); - auto planner = pref->planner_settings; - planner->setLastStop(true); - planner->setVerbatimPlan(true); - planner->setDisplayRuntime(true); - planner->setDisplayDuration(true); - planner->setDisplayTransitions(true); - planner->setDoo2breaks(true); - planner->setDropStoneMode(true); - planner->setSafetyStop(true); - planner->setSwitchAtRequiredStop(true); - - planner->setAscrate75(1); - planner->setAscrate50(2); - planner->setAscratestops(3); - planner->setAscratelast6m(4); - planner->setDescrate(5); - planner->setBottompo2(6); - planner->setDecopo2(7); - planner->setBestmixend(8); - planner->setReserveGas(9); - planner->setMinSwitchDuration(10); - planner->setBottomSac(11); - planner->setDecoSac(12); - - planner->setDecoMode(BUEHLMANN); - - TEST(planner->lastStop(), true); - TEST(planner->verbatimPlan(), true); - TEST(planner->displayRuntime(), true); - TEST(planner->displayDuration(), true); - TEST(planner->displayTransitions(), true); + auto planner = qPrefDivePlanner::instance(); + depth_t x; + + planner->set_last_stop(true); + planner->set_verbatim_plan(true); + planner->set_display_runtime(true); + planner->set_display_duration(true); + planner->set_display_transitions(true); + planner->set_doo2breaks(true); + planner->set_drop_stone_mode(true); + planner->set_safetystop(true); + planner->set_switch_at_req_stop(true); + + planner->set_ascrate75(1); + planner->set_ascrate50(2); + planner->set_ascratestops(3); + planner->set_ascratelast6m(4); + planner->set_descrate(5); + planner->set_bottompo2(6); + planner->set_decopo2(7); + x.mm = 8; + planner->set_bestmixend(x); + planner->set_reserve_gas(9); + planner->set_min_switch_duration(10); + planner->set_bottomsac(11); + planner->set_decosac(12); + + planner->set_planner_deco_mode(BUEHLMANN); + + TEST(planner->last_stop(), true); + TEST(planner->verbatim_plan(), true); + TEST(planner->display_runtime(), true); + TEST(planner->display_duration(), true); + TEST(planner->display_transitions(), true); TEST(planner->doo2breaks(), true); - TEST(planner->dropStoneMode(), true); - TEST(planner->safetyStop(), true); - TEST(planner->switchAtRequiredStop(), true); + TEST(planner->drop_stone_mode(), true); + TEST(planner->safetystop(), true); + TEST(planner->switch_at_req_stop(), true); TEST(planner->ascrate75(), 1); TEST(planner->ascrate50(), 2); @@ -220,48 +223,49 @@ void TestPreferences::testPreferences() TEST(planner->descrate(), 5); TEST(planner->bottompo2(), 6); TEST(planner->decopo2(), 7); - TEST(planner->bestmixend(), 8); - TEST(planner->reserveGas(), 9); - TEST(planner->minSwitchDuration(), 10); - TEST(planner->bottomSac(), 11); - TEST(planner->decoSac(), 12); - - TEST(planner->decoMode(), BUEHLMANN); - - planner->setLastStop(false); - planner->setVerbatimPlan(false); - planner->setDisplayRuntime(false); - planner->setDisplayDuration(false); - planner->setDisplayTransitions(false); - planner->setDoo2breaks(false); - planner->setDropStoneMode(false); - planner->setSafetyStop(false); - planner->setSwitchAtRequiredStop(false); - - planner->setAscrate75(11); - planner->setAscrate50(12); - planner->setAscratestops(13); - planner->setAscratelast6m(14); - planner->setDescrate(15); - planner->setBottompo2(16); - planner->setDecopo2(17); - planner->setBestmixend(18); - planner->setReserveGas(19); - planner->setMinSwitchDuration(110); - planner->setBottomSac(111); - planner->setDecoSac(112); - - planner->setDecoMode(RECREATIONAL); - - TEST(planner->lastStop(), false); - TEST(planner->verbatimPlan(), false); - TEST(planner->displayRuntime(), false); - TEST(planner->displayDuration(), false); - TEST(planner->displayTransitions(), false); + TEST(planner->bestmixend().mm, 8); + TEST(planner->reserve_gas(), 9); + TEST(planner->min_switch_duration(), 10); + TEST(planner->bottomsac(), 11); + TEST(planner->decosac(), 12); + + TEST(planner->planner_deco_mode(), BUEHLMANN); + + planner->set_last_stop(false); + planner->set_verbatim_plan(false); + planner->set_display_runtime(false); + planner->set_display_duration(false); + planner->set_display_transitions(false); + planner->set_doo2breaks(false); + planner->set_drop_stone_mode(false); + planner->set_safetystop(false); + planner->set_switch_at_req_stop(false); + + planner->set_ascrate75(11); + planner->set_ascrate50(12); + planner->set_ascratestops(13); + planner->set_ascratelast6m(14); + planner->set_descrate(15); + planner->set_bottompo2(16); + planner->set_decopo2(17); + x.mm = 18; + planner->set_bestmixend(x); + planner->set_reserve_gas(19); + planner->set_min_switch_duration(110); + planner->set_bottomsac(111); + planner->set_decosac(112); + + planner->set_planner_deco_mode(RECREATIONAL); + + TEST(planner->last_stop(), false); + TEST(planner->verbatim_plan(), false); + TEST(planner->display_runtime(), false); + TEST(planner->display_duration(), false); + TEST(planner->display_transitions(), false); TEST(planner->doo2breaks(), false); - TEST(planner->dropStoneMode(), false); - TEST(planner->safetyStop(), false); - TEST(planner->switchAtRequiredStop(), false); + TEST(planner->drop_stone_mode(), false); + TEST(planner->safetystop(), false); + TEST(planner->switch_at_req_stop(), false); TEST(planner->ascrate75(), 11); TEST(planner->ascrate50(), 12); @@ -270,13 +274,13 @@ void TestPreferences::testPreferences() TEST(planner->descrate(), 15); TEST(planner->bottompo2(), 16); TEST(planner->decopo2(), 17); - TEST(planner->bestmixend(), 18); - TEST(planner->reserveGas(), 19); - TEST(planner->minSwitchDuration(), 110); - TEST(planner->bottomSac(), 111); - TEST(planner->decoSac(), 112); + TEST(planner->bestmixend().mm, 18); + TEST(planner->reserve_gas(), 19); + TEST(planner->min_switch_duration(), 110); + TEST(planner->bottomsac(), 111); + TEST(planner->decosac(), 112); - TEST(planner->decoMode(), RECREATIONAL); + TEST(planner->planner_deco_mode(), RECREATIONAL); auto general = pref->general_settings; general->setDefaultFilename("filename"); |