summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-08 12:06:23 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-25 17:13:20 -0800
commitcd3c2266f9f687746770912bfc913c4f94bb124b (patch)
treea5094ecfa0f7c4fda4e97c7da7d093b5682750fe /tests
parent55483767763ca5d7d7c8f299f8939bda38301f1b (diff)
downloadsubsurface-cd3c2266f9f687746770912bfc913c4f94bb124b.tar.gz
dive planner: correct bottomsac/decosac calc.
Move conversion cuft <-> liter from desktop-widget/diveplanner.cpp to plannerShared, to facilitate the same results in mobile diveplanner Use Backend for bottomsac/decosac and update to check for switch LITER <-> CUFT Add bottomsac/decosac to QMLinterface. Signed-off-by: jan Iversen <jan@casacondor.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/testplannershared.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/testplannershared.cpp b/tests/testplannershared.cpp
index 3131590c5..f2655432c 100644
--- a/tests/testplannershared.cpp
+++ b/tests/testplannershared.cpp
@@ -145,9 +145,9 @@ void TestPlannerShared::test_gas()
// Remark return will from qPref is in m / 1000.
qPrefDivePlanner::set_bottomsac(2830);
- QCOMPARE(plannerShared::bottomsac(), 2.83);
+ QCOMPARE(int(plannerShared::bottomsac() * 1000), 99);
qPrefDivePlanner::set_bottomsac(16000);
- QCOMPARE(plannerShared::bottomsac(), 16);
+ QCOMPARE(int(plannerShared::bottomsac() * 1000), 565);
plannerShared::set_decosac(0.9);
QCOMPARE(qPrefDivePlanner::decosac(), 25485);
@@ -156,9 +156,9 @@ void TestPlannerShared::test_gas()
// Remark return will from qPref is in m / 1000.
qPrefDivePlanner::set_decosac(11500);
- QCOMPARE(plannerShared::decosac(), 11.5);
+ QCOMPARE(int(plannerShared::decosac() * 1000), 406);
qPrefDivePlanner::set_decosac(19800);
- QCOMPARE(plannerShared::decosac(), 19.8);
+ QCOMPARE(int(plannerShared::decosac() * 1000), 699);
// Remark bottompo2 is in BAR, even though unit system is
// Imperial, the desktop version is like that.