Skip to content

Commit

Permalink
Extend coverage by testing version_compare2 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Sep 11, 2019
1 parent bfe9427 commit dff3751
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/compare_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ static char comparison_to_char(int comp) {
}

static int version_test(const char* v1, const char* v2, int flags1, int flags2, int expected) {
int result = version_compare4(v1, v2, flags1, flags2);
int result;

if (flags1 == 0 && flags2 == 0) {
result = version_compare2(v1, v2);
} else {
result = version_compare4(v1, v2, flags1, flags2);
}

if (result == expected) {
fprintf(stderr, "[ OK ] \"%s\" (0x%x) %c \"%s\" (0x%x)\n", v1, flags1, comparison_to_char(expected), v2, flags2);
Expand Down

0 comments on commit dff3751

Please sign in to comment.