ProjectVersion tests, fix mixleading comment

This commit is contained in:
Lukas W
2016-08-29 09:04:27 +02:00
parent d2a5c496ab
commit 37dfa492dc
2 changed files with 4 additions and 1 deletions

View File

@@ -111,7 +111,7 @@ int ProjectVersion::compare(const ProjectVersion & a, const ProjectVersion & b,
return 0;
}
// make sure 0.x.y > 0.x.y-patch
// make sure 0.x.y > 0.x.y-alpha
if(a.getBuild().isEmpty())
{
return 1;
@@ -121,6 +121,7 @@ int ProjectVersion::compare(const ProjectVersion & a, const ProjectVersion & b,
return -1;
}
// 0.x.y-beta > 0.x.y-alpha
return QString::compare(a.getBuild(), b.getBuild());
}

View File

@@ -39,6 +39,8 @@ private slots:
QVERIFY(ProjectVersion("1.1.0", CompareType::Minor) == "1.1.5");
QVERIFY( ! ( ProjectVersion("3.1.0", CompareType::Minor) < "2.2.5" ) );
QVERIFY( ! ( ProjectVersion("2.5.0", CompareType::Release) < "2.2.5" ) );
QVERIFY(ProjectVersion("1.1.0") > "1.1.0-alpha");
QVERIFY(ProjectVersion("1.1.0-alpha") < "1.1.0-beta");
}
} ProjectVersionTests;