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

@ -152,14 +152,13 @@ void TestQPrefUnits::test_multiple()
// test multiple instances have the same information
prefs.units.length = units::METERS;
auto tst_direct = new qPrefUnits;
prefs.units.pressure = units::BAR;
auto tst = qPrefUnits::instance();
QCOMPARE(tst->length(), tst_direct->length());
QCOMPARE(tst->length(), qPrefUnits::length());
QCOMPARE(tst->length(), units::METERS);
QCOMPARE(tst->pressure(), tst_direct->pressure());
QCOMPARE(tst->pressure(), qPrefUnits::pressure());
QCOMPARE(tst->pressure(), units::BAR);
}