mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
tests: add framework for plannerShared test
Add TestPlannerShared test (cpp + h) Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
parent
9d34ab4bc4
commit
f92daa16ef
2 changed files with 98 additions and 0 deletions
79
tests/testplannershared.cpp
Normal file
79
tests/testplannershared.cpp
Normal file
|
@ -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)
|
19
tests/testplannershared.h
Normal file
19
tests/testplannershared.h
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue