diff --git a/lang/cpp/src/engineinfo.h b/lang/cpp/src/engineinfo.h index cd1b7a72..0bf7d0e8 100644 --- a/lang/cpp/src/engineinfo.h +++ b/lang/cpp/src/engineinfo.h @@ -87,13 +87,14 @@ public: bool operator > (const char* other) { - return !operator<(Version(other)); + return operator>(Version(other)); } bool operator > (const Version & other) { - return !operator<(other); + return !operator<(other) && !operator==(other); } + bool operator == (const Version& other) { return major == other.major diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp index 1e6bba41..9f7b1cec 100644 --- a/lang/qt/tests/t-various.cpp +++ b/lang/qt/tests/t-various.cpp @@ -241,6 +241,7 @@ private Q_SLOTS: 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("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"));