diff options
author | Ingo Klöcker <[email protected]> | 2020-10-15 14:45:31 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2020-10-23 11:50:16 +0000 |
commit | 2f53a2f4be86c0829213e2a9f846b7f8f0b106dc (patch) | |
tree | 2f9b899e9f601268dfe459f4ea00db3c171b80f8 /lang/cpp/src | |
parent | tests: Fix gcc incompatibility (diff) | |
download | gpgme-2f53a2f4be86c0829213e2a9f846b7f8f0b106dc.tar.gz gpgme-2f53a2f4be86c0829213e2a9f846b7f8f0b106dc.zip |
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.
Diffstat (limited to 'lang/cpp/src')
-rw-r--r-- | lang/cpp/src/engineinfo.h | 5 |
1 files changed, 3 insertions, 2 deletions
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 |