From 2f53a2f4be86c0829213e2a9f846b7f8f0b106dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Thu, 15 Oct 2020 16:45:31 +0200 Subject: cpp, qt: Fix version info comparison * lang/cpp/src/engineinfo.h (EngineInfo::Version::operator>(const Version &)): Fix logic. (EngineInfo::Version::operator>(const char *)): Use Version-overload of operator>. * lang/qt/tests/t-various.cpp: Add test. -- This fixes a logic error that 2.0.0 > 2.0.0 would return true. --- lang/cpp/src/engineinfo.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lang/cpp/src') 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 -- cgit v1.2.3