qt: Add test for version info
authorAndre Heinecke <aheinecke@intevation.de>
Mon, 4 Sep 2017 09:25:34 +0000 (11:25 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Mon, 4 Sep 2017 09:25:34 +0000 (11:25 +0200)
* lang/qt/tests/t-various.cpp (TestVarious::testVersion): New.

--
If it's not tested it does not work ;-)

lang/qt/tests/t-various.cpp

index fe121fd..7545628 100644 (file)
@@ -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();