tests: correct testqPref*.cpp to use static qPref* functions.

qPref* set/get functions are static.

remove creation of qPref* instances, reference
static functions.

Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2019-11-23 17:40:56 +01:00 committed by Dirk Hohndel
parent 54f8217eec
commit 6e846eb4c0
13 changed files with 38 additions and 61 deletions

View file

@ -312,17 +312,14 @@ void TestQPrefDivePlanner::test_multiple()
{
// test multiple instances have the same information
prefs.sacfactor = 22;
prefs.safetystop = true;
auto tst_direct = new qPrefDivePlanner;
prefs.sacfactor = 32;
auto tst = qPrefDivePlanner::instance();
QCOMPARE(tst->sacfactor(), tst_direct->sacfactor());
QCOMPARE(tst->safetystop(), tst_direct->safetystop());
QCOMPARE(tst_direct->sacfactor(), 32);
QCOMPARE(tst_direct->safetystop(), true);
QCOMPARE(tst->sacfactor(), qPrefDivePlanner::sacfactor());
QCOMPARE(tst->safetystop(), qPrefDivePlanner::safetystop());
QCOMPARE(qPrefDivePlanner::sacfactor(), 32);
QCOMPARE(qPrefDivePlanner::safetystop(), true);
}
#define TEST(METHOD, VALUE) \