From cd3c2266f9f687746770912bfc913c4f94bb124b Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Wed, 8 Jan 2020 12:06:23 +0100 Subject: 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 --- tests/testplannershared.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/testplannershared.cpp') 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. -- cgit v1.2.3-70-g09d2