From bd5d470cef513b2f459316869b81267cde7a9f13 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Mon, 4 Sep 2017 11:25:34 +0200 Subject: [PATCH] qt: Add test for version info * lang/qt/tests/t-various.cpp (TestVarious::testVersion): New. -- If it's not tested it does not work ;-) --- lang/qt/tests/t-various.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp index fe121fd5..75456281 100644 --- a/lang/qt/tests/t-various.cpp +++ b/lang/qt/tests/t-various.cpp @@ -151,6 +151,19 @@ private Q_SLOTS: QVERIFY(id_revoked); } + void testVersion() + { + QVERIFY(EngineInfo::Version("2.1.0") < EngineInfo::Version("2.1.1")); + QVERIFY(EngineInfo::Version("2.1.10") < EngineInfo::Version("2.1.11")); + QVERIFY(EngineInfo::Version("2.2.0") > EngineInfo::Version("2.1.19")); + QVERIFY(EngineInfo::Version("1.0.0") < EngineInfo::Version("2.0.0")); + QVERIFY(EngineInfo::Version("0.1.0") < EngineInfo::Version("1.0.0")); + QVERIFY(!(EngineInfo::Version("2.0.0") < EngineInfo::Version("2.0.0"))); + QVERIFY(EngineInfo::Version("3.0.0") > EngineInfo::Version("2.3.20")); + QVERIFY(EngineInfo::Version("3.0.1") > EngineInfo::Version("3.0.0")); + QVERIFY(EngineInfo::Version("3.1.0") > EngineInfo::Version("3.0.20")); + } + void initTestCase() { QGpgMETest::initTestCase();