summaryrefslogtreecommitdiffstats
path: root/tests/testplannershared.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2019-12-30 18:29:51 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-31 04:32:34 +0900
commit80b55b9e8515bcb960aa04058c6a04e4da5d3c74 (patch)
treec14b0535a2faabca1395426849fdacfe691f6248 /tests/testplannershared.cpp
parent2f16f7539e7b24a3732e696c6447d5daf74a0525 (diff)
downloadsubsurface-80b55b9e8515bcb960aa04058c6a04e4da5d3c74.tar.gz
tests: correct decosac/bottomsac in imperial.
The getter returns alwayes in m/1000, making the calculations identical, independent if the system is in Metric or Imperial units. Correct getter test cases. Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'tests/testplannershared.cpp')
-rw-r--r--tests/testplannershared.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/testplannershared.cpp b/tests/testplannershared.cpp
index 451f67f83..a0af6dc37 100644
--- a/tests/testplannershared.cpp
+++ b/tests/testplannershared.cpp
@@ -251,19 +251,23 @@ void TestPlannerShared::test_gas()
QCOMPARE(qPrefDivePlanner::bottomsac(), 25485);
plannerShared::set_bottomsac(0.01);
QCOMPARE(qPrefDivePlanner::bottomsac(), 283);
- qPrefDivePlanner::set_bottomsac(11327);
-//Not implemented QCOMPARE(plannerShared::bottomsac(), 0.4);
- qPrefDivePlanner::set_bottomsac(19822);
-//Not implemented QCOMPARE(plannerShared::bottomsac(), 0.7);
+
+ // Remark return will from qPref is in m / 1000.
+ qPrefDivePlanner::set_bottomsac(2830);
+ QCOMPARE(plannerShared::bottomsac(), 2.83);
+ qPrefDivePlanner::set_bottomsac(16000);
+ QCOMPARE(plannerShared::bottomsac(), 16);
plannerShared::set_decosac(0.9);
QCOMPARE(qPrefDivePlanner::decosac(), 25485);
plannerShared::set_decosac(0.01);
QCOMPARE(qPrefDivePlanner::decosac(), 283);
- qPrefDivePlanner::set_decosac(11327);
-//Not implemented QCOMPARE(plannerShared::decosac(), 0.4);
- qPrefDivePlanner::set_decosac(19822);
-//Not implemented QCOMPARE(plannerShared::decosac(), 0.7);
+
+ // Remark return will from qPref is in m / 1000.
+ qPrefDivePlanner::set_decosac(11500);
+ QCOMPARE(plannerShared::decosac(), 11.5);
+ qPrefDivePlanner::set_decosac(19800);
+ QCOMPARE(plannerShared::decosac(), 19.8);
// Remark bottompo2 is in BAR, even though unit system is
// Imperial, the desktop version is like that.