aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-08-23 22:43:33 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-08-29 06:49:44 -0700
commit82aac4efff7e0836e879e52b4e4e0f7301b165a9 (patch)
treef5f053d47bbd804c6545c668ee433c290b47f87f /tests
parent58d79488714ff7773916f3efe0970c424c8bd1cd (diff)
downloadsubsurface-82aac4efff7e0836e879e52b4e4e0f7301b165a9.tar.gz
Make plan take dive and decotimestep as arguments
...rather than use a global variable and a macro. This should be a no-op in preparation to allow planning several versions of a dive. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/testplan.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/testplan.cpp b/tests/testplan.cpp
index 7b4671cfd..c67b365e9 100644
--- a/tests/testplan.cpp
+++ b/tests/testplan.cpp
@@ -10,7 +10,7 @@
#define DEBUG 1
// testing the dive plan algorithm
-extern bool plan(struct diveplan *diveplan, struct deco_state **cached_datap, bool is_planner, bool show_disclaimer);
+extern bool plan(struct diveplan *diveplan, struct dive *dive, int timestep, struct deco_state **cached_datap, bool is_planner, bool show_disclaimer);
extern pressure_t first_ceiling_pressure;
@@ -364,7 +364,7 @@ void TestPlan::testMetric()
struct diveplan testPlan = {};
setupPlan(&testPlan);
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -404,7 +404,7 @@ void TestPlan::testImperial()
struct diveplan testPlan = {};
setupPlan(&testPlan);
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -444,7 +444,7 @@ void TestPlan::testVpmbMetric45m30minTx()
setupPlanVpmb45m30mTx(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -474,7 +474,7 @@ void TestPlan::testVpmbMetric60m10minTx()
setupPlanVpmb60m10mTx(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -504,7 +504,7 @@ void TestPlan::testVpmbMetric60m30minAir()
setupPlanVpmb60m30minAir(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -534,7 +534,7 @@ void TestPlan::testVpmbMetric60m30minEan50()
setupPlanVpmb60m30minEan50(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -570,7 +570,7 @@ void TestPlan::testVpmbMetric60m30minTx()
setupPlanVpmb60m30minTx(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -606,7 +606,7 @@ void TestPlan::testVpmbMetric100m60min()
setupPlanVpmb100m60min(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -648,7 +648,7 @@ void TestPlan::testVpmbMetricMultiLevelAir()
setupPlanVpmbMultiLevelAir(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -678,7 +678,7 @@ void TestPlan::testVpmbMetric100m10min()
setupPlanVpmb100m10min(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -724,7 +724,7 @@ void TestPlan::testVpmbMetricRepeat()
setupPlanVpmb30m20min(&testPlan);
setCurrentAppState("PlanDive");
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -744,7 +744,7 @@ void TestPlan::testVpmbMetricRepeat()
int firstDiveRunTimeSeconds = displayed_dive.dc.duration.seconds;
setupPlanVpmb100mTo70m30min(&testPlan);
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);
@@ -780,7 +780,7 @@ void TestPlan::testVpmbMetricRepeat()
QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 127u * 60u + 20u, 127u * 60u + 20u));
setupPlanVpmb30m20min(&testPlan);
- plan(&testPlan, &cache, 1, 0);
+ plan(&testPlan, &displayed_dive, 60, &cache, 1, 0);
#if DEBUG
free(displayed_dive.notes);