diff options
Diffstat (limited to 'tests/testqPrefGeneral.cpp')
-rw-r--r-- | tests/testqPrefGeneral.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/tests/testqPrefGeneral.cpp b/tests/testqPrefGeneral.cpp index 1463b914b..9718650ed 100644 --- a/tests/testqPrefGeneral.cpp +++ b/tests/testqPrefGeneral.cpp @@ -23,24 +23,16 @@ void TestQPrefGeneral::test_struct_get() auto tst = qPrefGeneral::instance(); - prefs.auto_recalculate_thumbnails = true; prefs.default_filename = copy_qstring("new base12"); prefs.default_file_behavior = UNDEFINED_DEFAULT_FILE; prefs.defaultsetpoint = 14; - prefs.extract_video_thumbnails = true; - prefs.extract_video_thumbnails_position = 15; - prefs.ffmpeg_executable = copy_qstring("new base16"); prefs.o2consumption = 17; prefs.pscr_ratio = 18; prefs.use_default_file = true; - QCOMPARE(tst->auto_recalculate_thumbnails(), prefs.auto_recalculate_thumbnails); QCOMPARE(tst->default_filename(), QString(prefs.default_filename)); QCOMPARE(tst->default_file_behavior(), prefs.default_file_behavior); QCOMPARE(tst->defaultsetpoint(), prefs.defaultsetpoint); - QCOMPARE(tst->extract_video_thumbnails(), prefs.extract_video_thumbnails); - QCOMPARE(tst->extract_video_thumbnails_position(), prefs.extract_video_thumbnails_position); - QCOMPARE(tst->ffmpeg_executable(), QString(prefs.ffmpeg_executable)); QCOMPARE(tst->o2consumption(), prefs.o2consumption); QCOMPARE(tst->pscr_ratio(), prefs.pscr_ratio); QCOMPARE(tst->use_default_file(), prefs.use_default_file); @@ -52,26 +44,18 @@ void TestQPrefGeneral::test_set_struct() auto tst = qPrefGeneral::instance(); - tst->set_auto_recalculate_thumbnails(false); tst->set_default_filename("new base22"); tst->set_default_file_behavior(LOCAL_DEFAULT_FILE); tst->set_defaultsetpoint(24); - tst->set_extract_video_thumbnails(false); - tst->set_extract_video_thumbnails_position(25); - tst->set_ffmpeg_executable("new base26"); 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_filename), QString("new base22")); QCOMPARE(prefs.default_file_behavior, LOCAL_DEFAULT_FILE); QCOMPARE(prefs.defaultsetpoint, 24); - QCOMPARE(prefs.extract_video_thumbnails, false); - QCOMPARE(prefs.extract_video_thumbnails_position, 25); - QCOMPARE(QString(prefs.ffmpeg_executable), QString("new base26")); QCOMPARE(prefs.o2consumption, 27); QCOMPARE(prefs.pscr_ratio, 28); QCOMPARE(prefs.use_default_file, false); @@ -85,38 +69,26 @@ void TestQPrefGeneral::test_set_load_struct() auto tst = qPrefGeneral::instance(); - tst->set_auto_recalculate_thumbnails(true); tst->set_default_filename("new base32"); tst->set_default_file_behavior(NO_DEFAULT_FILE); tst->set_defaultsetpoint(34); - tst->set_extract_video_thumbnails(true); - tst->set_extract_video_thumbnails_position(35); - tst->set_ffmpeg_executable("new base36"); 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_filename = copy_qstring("error"); prefs.default_file_behavior = UNDEFINED_DEFAULT_FILE; prefs.defaultsetpoint = 14; - prefs.extract_video_thumbnails = false; - prefs.extract_video_thumbnails_position = 15; - prefs.ffmpeg_executable = copy_qstring("error"); prefs.o2consumption = 17; prefs.pscr_ratio = 18; prefs.use_default_file = false; tst->load(); - QCOMPARE(prefs.auto_recalculate_thumbnails, true); QCOMPARE(QString(prefs.default_filename), QString("new base32")); QCOMPARE(prefs.default_file_behavior, NO_DEFAULT_FILE); QCOMPARE(prefs.defaultsetpoint, 34); - QCOMPARE(prefs.extract_video_thumbnails, true); - QCOMPARE(prefs.extract_video_thumbnails_position, 35); - QCOMPARE(QString(prefs.ffmpeg_executable), QString("new base36")); QCOMPARE(prefs.o2consumption, 37); QCOMPARE(prefs.pscr_ratio, 38); QCOMPARE(prefs.use_default_file, true); @@ -130,37 +102,25 @@ void TestQPrefGeneral::test_struct_disk() auto tst = qPrefGeneral::instance(); - prefs.auto_recalculate_thumbnails = true; prefs.default_filename = copy_qstring("base42"); prefs.default_file_behavior = CLOUD_DEFAULT_FILE; prefs.defaultsetpoint = 44; - prefs.extract_video_thumbnails = true; - prefs.extract_video_thumbnails_position = 45; - prefs.ffmpeg_executable = copy_qstring("base46"); prefs.o2consumption = 47; prefs.pscr_ratio = 48; prefs.use_default_file = true; tst->sync(); - prefs.auto_recalculate_thumbnails = false; prefs.default_filename = copy_qstring("error"); prefs.default_file_behavior = UNDEFINED_DEFAULT_FILE; prefs.defaultsetpoint = 14; - prefs.extract_video_thumbnails = false; - prefs.extract_video_thumbnails_position = 15; - prefs.ffmpeg_executable = copy_qstring("error"); prefs.o2consumption = 17; prefs.pscr_ratio = 18; prefs.use_default_file = false; tst->load(); - QCOMPARE(prefs.auto_recalculate_thumbnails, true); QCOMPARE(QString(prefs.default_filename), QString("base42")); QCOMPARE(prefs.default_file_behavior, CLOUD_DEFAULT_FILE); QCOMPARE(prefs.defaultsetpoint, 44); - QCOMPARE(prefs.extract_video_thumbnails, true); - QCOMPARE(prefs.extract_video_thumbnails_position, 45); - QCOMPARE(QString(prefs.ffmpeg_executable), QString("base46")); QCOMPARE(prefs.o2consumption, 47); QCOMPARE(prefs.pscr_ratio, 48); QCOMPARE(prefs.use_default_file, true); @@ -223,44 +183,27 @@ void TestQPrefGeneral::test_oldPreferences() void TestQPrefGeneral::test_signals() { - QSignalSpy spy1(qPrefGeneral::instance(), &qPrefGeneral::auto_recalculate_thumbnailsChanged); QSignalSpy spy3(qPrefGeneral::instance(), &qPrefGeneral::default_filenameChanged); QSignalSpy spy4(qPrefGeneral::instance(), &qPrefGeneral::default_file_behaviorChanged); QSignalSpy spy5(qPrefGeneral::instance(), &qPrefGeneral::defaultsetpointChanged); - QSignalSpy spy6(qPrefGeneral::instance(), &qPrefGeneral::extract_video_thumbnailsChanged); - QSignalSpy spy7(qPrefGeneral::instance(), &qPrefGeneral::extract_video_thumbnails_positionChanged); - QSignalSpy spy8(qPrefGeneral::instance(), &qPrefGeneral::ffmpeg_executableChanged); QSignalSpy spy9(qPrefGeneral::instance(), &qPrefGeneral::o2consumptionChanged); QSignalSpy spy10(qPrefGeneral::instance(), &qPrefGeneral::pscr_ratioChanged); QSignalSpy spy11(qPrefGeneral::instance(), &qPrefGeneral::use_default_fileChanged); QSignalSpy spy12(qPrefGeneral::instance(), &qPrefGeneral::diveshareExport_uidChanged); QSignalSpy spy13(qPrefGeneral::instance(), &qPrefGeneral::diveshareExport_privateChanged); - prefs.auto_recalculate_thumbnails = true; - qPrefGeneral::set_auto_recalculate_thumbnails(false); - qPrefGeneral::set_default_filename("new base22"); qPrefGeneral::set_default_file_behavior(LOCAL_DEFAULT_FILE); qPrefGeneral::set_defaultsetpoint(24); - qPrefGeneral::set_extract_video_thumbnails(false); - qPrefGeneral::set_extract_video_thumbnails_position(25); - qPrefGeneral::set_ffmpeg_executable("new base26"); qPrefGeneral::set_o2consumption(27); qPrefGeneral::set_pscr_ratio(28); qPrefGeneral::set_use_default_file(false); qPrefGeneral::set_diveshareExport_uid("uid1"); qPrefGeneral::set_diveshareExport_private(false); - QCOMPARE(spy1.count(), 1); - - QVERIFY(spy1.takeFirst().at(0).toBool() == false); - qPrefGeneral::set_default_filename("new base22"); qPrefGeneral::set_default_file_behavior(LOCAL_DEFAULT_FILE); qPrefGeneral::set_defaultsetpoint(24); - qPrefGeneral::set_extract_video_thumbnails(false); - qPrefGeneral::set_extract_video_thumbnails_position(25); - qPrefGeneral::set_ffmpeg_executable("new base26"); qPrefGeneral::set_o2consumption(27); qPrefGeneral::set_pscr_ratio(28); qPrefGeneral::set_use_default_file(false); |