From 80b55b9e8515bcb960aa04058c6a04e4da5d3c74 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Mon, 30 Dec 2019 18:29:51 +0100 Subject: 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 --- tests/testplannershared.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tests/testplannershared.cpp') 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. -- cgit v1.2.3-70-g09d2