File: testupdater.cpp

package info (click to toggle)
owncloud-client 2.2.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,144 kB
  • ctags: 5,433
  • sloc: cpp: 35,894; ansic: 7,917; perl: 1,474; python: 217; ruby: 174; makefile: 38; sh: 23
file content (34 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
   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"