1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-11-14 16:42:47 +01:00
Nextcloud-Desktop/test/testupdater.cpp
Hefee edb3759684 For tests we do not need a xserver running.
Use for tests QTEST_GUILESS_MAIN and QTEST_APPLESS_MAIN.
2016-05-12 11:34:21 +02:00

35 lines
872 B
C++

/*
This software is in the public domain, furnished "as is", without technical
support, and with no warranty, express or implied, as to its usefulness for
any purpose.
*/
#include <QtTest>
#include "updater/updater.h"
#include "updater/ocupdater.h"
using namespace OCC;
class TestUpdater : public QObject
{
Q_OBJECT
private slots:
void testVersionToInt()
{
qint64 lowVersion = Updater::Helper::versionToInt(1,2,80,3000);
QCOMPARE(Updater::Helper::stringVersionToInt("1.2.80.3000"), lowVersion);
qint64 highVersion = Updater::Helper::versionToInt(99,2,80,3000);
qint64 currVersion = Updater::Helper::currentVersionToInt();
QVERIFY(currVersion > 0);
QVERIFY(currVersion > lowVersion);
QVERIFY(currVersion < highVersion);
}
};
QTEST_APPLESS_MAIN(TestUpdater)
#include "testupdater.moc"