Пример #1
0
bool operator!=(const Version &v1, const Version &v2) {
    if (v1.major() != v2.major())
        return true;
    if (v1.minor() != v2.minor())
        return true;
    if (v1.bug() != v2.bug())
        return true;
    if (v1.build() != v1.build())
        return true;

    // Else
    return false;
}
Пример #2
0
bool operator>(const Version &v1, const Version &v2) {
    if (v1.major() > v2.major())
        return true;
    else if (v1.major() < v2.major())
        return false;

    if (v1.minor() > v2.minor())
        return true;
    else if (v1.minor() < v2.minor())
        return false;

    if (v1.bug() > v2.bug())
        return true;
    else if (v1.bug() < v2.bug())
        return false;

    if (v1.build() > v1.build())
        return true;
    else
        return false;
}
Пример #3
0
bool operator>(const Version& lhs, const Version& rhs) noexcept {
  return (lhs.major() == rhs.major()) ? (lhs.minor() > rhs.minor()) : (lhs.major() > rhs.major());
}
Пример #4
0
/*
* Test if initial version equals 0/0/0
*/
TEST(Version, HoldsZeroVersionIfUninitialized) {
	Version version;
	ASSERT_THAT(version.major(), Eq(0));
	ASSERT_THAT(version.minor(), Eq(0));
	ASSERT_THAT(version.release(), Eq(0));
}
Пример #5
0
bool operator==(const Version& lhs, const Version& rhs) noexcept {
  return lhs.major() == rhs.major()
         and
         lhs.minor() == rhs.minor();
}