> On 06 Jul 2015, at 15:51, Dirk Hohndel <[email protected]> wrote:
> 
> On Mon, Jul 06, 2015 at 06:36:58AM -0700, Dirk Hohndel wrote:
>> 
>> I seem to get 107 with the latest build. 9/9/9/3 m/min for ascent.
>> GF 100/100
>> last stop at 6
>> drop down to depth and 30 minutes at 79m
>> 0 min minimum switch duration
>> 
>> depth duration runtime gas
>> 79m 3min 3min (15/45)
>> 79m 27min 30min
>> 33m 5min 35min EAN38
> 

I have to look again at your numbers, but for the number in this patch I get 
agreement with the dives I compute in the UI (as attached).

Best
Robert

From 49b27d7f113155679bd46cb152656f54d695c29f Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Mon, 6 Jul 2015 15:44:05 +0200
Subject: [PATCH] Fix typo in test and some numbers

With these values I reproduce the runtimes from the UI.

Signed-off-by: Robert C. Helling <[email protected]>
---
 tests/testplan.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/testplan.cpp b/tests/testplan.cpp
index 8fa0921..88f1366 100644
--- a/tests/testplan.cpp
+++ b/tests/testplan.cpp
@@ -4,6 +4,8 @@
 #include "units.h"
 #include <QDebug>
 
+#define DEBUG  1
+
 // testing the dive plan algorithm
 extern bool plan(struct diveplan *diveplan, char **cached_datap, bool 
is_planner, bool show_disclaimer);
 
@@ -15,12 +17,11 @@ void setupPrefs()
        prefs.ascratestops = prefs.ascrate50;
        prefs.ascratelast6m = feet_to_mm(10) / 60;
        prefs.last_stop = true;
-
 }
 
 void setupPlan(struct diveplan *dp)
 {
-       dp->salinity = 10030;
+       dp->salinity = 10300;
        dp->surface_pressure = 1013;
        dp->gfhigh = 100;
        dp->gflow = 100;
@@ -77,7 +78,7 @@ void TestPlan::testMetric()
        QCOMPARE(ev->value, 100);
        QCOMPARE(get_depth_at_time(&displayed_dive.dc, ev->time.seconds), 6000);
        // check expected run time of 105 minutes
-       QCOMPARE(displayed_dive.dc.duration.seconds, 104u * 60u);
+       QCOMPARE(displayed_dive.dc.duration.seconds, 108u * 60u);
 }
 
 void TestPlan::testImperial()
@@ -113,7 +114,7 @@ void TestPlan::testImperial()
        QCOMPARE(ev->value, 100);
        QCOMPARE(get_depth_at_time(&displayed_dive.dc, ev->time.seconds), 6096);
        // check expected run time of 105 minutes
-       QCOMPARE(displayed_dive.dc.duration.seconds, 105u * 60u);
+       QCOMPARE(displayed_dive.dc.duration.seconds, 110u * 60u - 2u);
 }
 
 QTEST_MAIN(TestPlan)
-- 
1.9.5 (Apple Git-50.3)

Attachment: testdiveimperial2.xml
Description: XML document

Attachment: testdivemetric2.xml
Description: XML document


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to