summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2019-12-25 16:16:15 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-27 05:40:26 +0900
commitf92daa16ef2490a2675941dc71d3b3a063261f68 (patch)
treebaaf490c864838eedf69318a5b51fe85e875f275 /tests
parent9d34ab4bc43dbb59822a7fd5a47a1a2f00ad3c0a (diff)
downloadsubsurface-f92daa16ef2490a2675941dc71d3b3a063261f68.tar.gz
tests: add framework for plannerShared test
Add TestPlannerShared test (cpp + h) Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/testplannershared.cpp79
-rw-r--r--tests/testplannershared.h19
2 files changed, 98 insertions, 0 deletions
diff --git a/tests/testplannershared.cpp b/tests/testplannershared.cpp
new file mode 100644
index 000000000..eb03f1345
--- /dev/null
+++ b/tests/testplannershared.cpp
@@ -0,0 +1,79 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "testplannershared.h"
+#include "backend-shared/plannershared.h"
+
+#include <QTest>
+#include <QSignalSpy>
+
+void TestPlannerShared::initTestCase()
+{
+ QCoreApplication::setOrganizationName("Subsurface");
+ QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
+ QCoreApplication::setApplicationName("SubsurfaceTestPlannerShared");
+ plannerShared::instance();
+}
+
+void TestPlannerShared::test_rates()
+
+{
+ // Rates all use meters pr time unit
+ // test values have been researched with official subsurface 4.9.3
+
+ // UI (meters) - plist value UI (feet) - plist value
+ // 16m - 267 33f - 168
+ // 7m - 117 27f - 137
+ // 8m - 133 40f - 203
+ // 10m - 167 35f - 178
+
+ // Variables to test
+ // ascratelast6m
+ // ascratestops
+ // ascrate50
+ // ascrate75
+ // descrate
+}
+
+void TestPlannerShared::test_planning()
+{
+ // Variables to test
+ // dive_mode
+ //OC, CCR, PSCR, FREEDIVE, NUM_DIVEMODE, UNDEF_COMP_TYPE
+
+ // planner_deco_mode
+ // dobailout
+ // reserve_gas
+ // safetystop
+ // gflow
+ // gfhigh
+ // vpmb_conservatism
+ // drop_stone_mode
+ // last_stop
+ // switch_at_req_stop
+ // doo2breaks
+ // min_switch_duration
+}
+
+void TestPlannerShared::test_gas()
+{
+ // Variables to test
+ // bottomsac
+ // decosac
+ // problemsolvingtime
+ // sacfactor
+ // o2narcotic
+ // bottompo2
+ // decopo2
+ // bestmixend
+}
+
+void TestPlannerShared::test_notes()
+{
+ // Variables to test
+ // display_runtime
+ // display_duration
+ // display_transitions
+ // verbatim_plan
+ // display_variations
+}
+
+QTEST_MAIN(TestPlannerShared)
diff --git a/tests/testplannershared.h b/tests/testplannershared.h
new file mode 100644
index 000000000..fb483149b
--- /dev/null
+++ b/tests/testplannershared.h
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef TESTPLANNERSHARED_H
+#define TESTPLANNERSHARED_H
+#include <QObject>
+
+class TestPlannerShared : public QObject {
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+
+ // test case grouping correspond to panels diveplanner window
+ void test_rates();
+ void test_planning();
+ void test_gas();
+ void test_notes();
+};
+
+#endif // TESTPLANNERSHARED_H