Add test cases for version

This commit is contained in:
2024-08-17 15:38:49 +02:00
parent 4333882275
commit 14c771854a
3 changed files with 562 additions and 11 deletions

View File

@@ -53,16 +53,16 @@ namespace OpenVulkano
//endregion
//region Comparison operators
[[nodiscard]] bool operator ==(const Version& rhs) { return Compare(rhs) == 0; }
[[nodiscard]] bool operator !=(const Version& rhs) { return Compare(rhs); }
[[nodiscard]] bool operator < (const Version& rhs) { return Compare(rhs) < 0; }
[[nodiscard]] bool operator <=(const Version& rhs) { return Compare(rhs) < 1; }
[[nodiscard]] bool operator > (const Version& rhs) { return Compare(rhs) > 0; }
[[nodiscard]] bool operator >=(const Version& rhs) { return Compare(rhs) > -1; }
[[nodiscard]] bool operator ==(const Version& rhs) const { return Compare(rhs) == 0; }
[[nodiscard]] bool operator !=(const Version& rhs) const { return Compare(rhs); }
[[nodiscard]] bool operator < (const Version& rhs) const { return Compare(rhs) < 0; }
[[nodiscard]] bool operator <=(const Version& rhs) const { return Compare(rhs) < 1; }
[[nodiscard]] bool operator > (const Version& rhs) const { return Compare(rhs) > 0; }
[[nodiscard]] bool operator >=(const Version& rhs) const { return Compare(rhs) > -1; }
//endregion
private:
[[nodiscard]] int Compare(const Version& other);
[[nodiscard]] int Compare(const Version& other) const;
[[nodiscard]] int CompareBuildNr(const Version& other) const;
[[nodiscard]] int CompareTimestamp(const Version& other) const;
[[nodiscard]] int CompareComponents(const Version& other) const;