Skip to content

Commit

Permalink
ProjectVersion tests, fix mixleading comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Aug 29, 2016
1 parent d2a5c49 commit 37dfa49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/ProjectVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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());
}

Expand Down
2 changes: 2 additions & 0 deletions tests/src/core/ProjectVersionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 37dfa49

Please sign in to comment.