From dff37514cb572f370130c69a12fb0c33769779d0 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Wed, 11 Sep 2019 21:44:03 +0300 Subject: [PATCH] Extend coverage by testing version_compare2 as well --- tests/compare_test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/compare_test.c b/tests/compare_test.c index 99847a8..12da1a7 100644 --- a/tests/compare_test.c +++ b/tests/compare_test.c @@ -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);