testupdater.cpp 872 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. This software is in the public domain, furnished "as is", without technical
  3. support, and with no warranty, express or implied, as to its usefulness for
  4. any purpose.
  5. */
  6. #include <QtTest>
  7. #include "updater/updater.h"
  8. #include "updater/ocupdater.h"
  9. using namespace OCC;
  10. class TestUpdater : public QObject
  11. {
  12. Q_OBJECT
  13. private slots:
  14. void testVersionToInt()
  15. {
  16. qint64 lowVersion = Updater::Helper::versionToInt(1,2,80,3000);
  17. QCOMPARE(Updater::Helper::stringVersionToInt("1.2.80.3000"), lowVersion);
  18. qint64 highVersion = Updater::Helper::versionToInt(99,2,80,3000);
  19. qint64 currVersion = Updater::Helper::currentVersionToInt();
  20. QVERIFY(currVersion > 0);
  21. QVERIFY(currVersion > lowVersion);
  22. QVERIFY(currVersion < highVersion);
  23. }
  24. };
  25. QTEST_APPLESS_MAIN(TestUpdater)
  26. #include "testupdater.moc"