qt: Add test for version info

* lang/qt/tests/t-various.cpp (TestVarious::testVersion): New.

--
If it's not tested it does not work ;-)
This commit is contained in:
Andre Heinecke 2017-09-04 11:25:34 +02:00
parent 58d7bcead3
commit bd5d470cef
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View 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();