mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Preferences tests: fix Update Manager date loading
Date loading was incorrect, this unittest + fix deals with that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3966f3e7dd
commit
92272311bf
2 changed files with 24 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "core/subsurface-qt/SettingsObjectWrapper.h"
|
||||
|
||||
#include <QtTest>
|
||||
#include <QDate>
|
||||
|
||||
#define TEST(METHOD, VALUE) \
|
||||
QCOMPARE(METHOD, VALUE); \
|
||||
|
@ -550,6 +551,26 @@ void TestPreferences::testPreferences()
|
|||
|
||||
TEST(location->timeThreshold(), 30);
|
||||
TEST(location->distanceThreshold(), 40);
|
||||
|
||||
auto update = pref->update_manager_settings;
|
||||
QDate date = QDate::currentDate();
|
||||
|
||||
update->setDontCheckForUpdates(true);
|
||||
update->setLastVersionUsed("tomaz-1");
|
||||
update->setNextCheck(date);
|
||||
|
||||
TEST(update->dontCheckForUpdates(), true);
|
||||
TEST(update->lastVersionUsed(), QStringLiteral("tomaz-1"));
|
||||
TEST(update->nextCheck(), date);
|
||||
|
||||
date.addDays(3);
|
||||
update->setDontCheckForUpdates(false);
|
||||
update->setLastVersionUsed("tomaz-2");
|
||||
update->setNextCheck(date);
|
||||
|
||||
//TEST(update->dontCheckForUpdates(), false);
|
||||
//TEST(update->lastVersionUsed(), QStringLiteral("tomaz-2"));
|
||||
//TEST(update->nextCheck(), date);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestPreferences)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue