From 5f4a040dd217c07a341bd03fe80fe19747d1541e Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Mon, 20 Aug 2018 12:50:21 +0200 Subject: core/tests: add class var to qPrefGeneral Add static class variables to qPrefGeneral (and remove QSettings from desktop-widgets) Signed-off-by: Jan Iversen --- tests/testqPrefGeneral.cpp | 8 ++++++++ tests/tst_qPrefGeneral.qml | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/testqPrefGeneral.cpp b/tests/testqPrefGeneral.cpp index 2e6ec76c0..c26616e90 100644 --- a/tests/testqPrefGeneral.cpp +++ b/tests/testqPrefGeneral.cpp @@ -62,6 +62,8 @@ void TestQPrefGeneral::test_set_struct() tst->set_o2consumption(27); tst->set_pscr_ratio(28); tst->set_use_default_file(false); + tst->set_diveshareExport_uid("uid1"); + tst->set_diveshareExport_private(false); QCOMPARE(prefs.auto_recalculate_thumbnails, false); QCOMPARE(QString(prefs.default_cylinder), QString("new base21")); @@ -74,6 +76,8 @@ void TestQPrefGeneral::test_set_struct() QCOMPARE(prefs.o2consumption, 27); QCOMPARE(prefs.pscr_ratio, 28); QCOMPARE(prefs.use_default_file, false); + QCOMPARE(tst->diveshareExport_uid(), QString("uid1")); + QCOMPARE(tst->diveshareExport_private(), false); } void TestQPrefGeneral::test_set_load_struct() @@ -93,6 +97,8 @@ void TestQPrefGeneral::test_set_load_struct() tst->set_o2consumption(37); tst->set_pscr_ratio(38); tst->set_use_default_file(true); + tst->set_diveshareExport_uid("uid2"); + tst->set_diveshareExport_private(true); prefs.auto_recalculate_thumbnails = false; prefs.default_cylinder = copy_qstring("error"); @@ -118,6 +124,8 @@ void TestQPrefGeneral::test_set_load_struct() QCOMPARE(prefs.o2consumption, 37); QCOMPARE(prefs.pscr_ratio, 38); QCOMPARE(prefs.use_default_file, true); + QCOMPARE(tst->diveshareExport_uid(), QString("uid2")); + QCOMPARE(tst->diveshareExport_private(), true); } void TestQPrefGeneral::test_struct_disk() diff --git a/tests/tst_qPrefGeneral.qml b/tests/tst_qPrefGeneral.qml index eb66383af..5c1669056 100644 --- a/tests/tst_qPrefGeneral.qml +++ b/tests/tst_qPrefGeneral.qml @@ -58,5 +58,13 @@ TestCase { var x11 = tst.use_default_file tst.use_default_file = true compare(tst.use_default_file, true) + + var x12 = tst.diveshareExport_uid + tst.diveshareExport_uid = "myUid" + compare(tst.diveshareExport_uid, "myUid") + + var x13 = tst.diveshareExport_private + tst.diveshareExport_private = true + compare(tst.diveshareExport_private, true) } } -- cgit v1.2.3-70-g09d2