From e2879a066715824e4254cb612dfb2cb17d76c869 Mon Sep 17 00:00:00 2001 From: John Vu Date: Tue, 23 Jun 2009 19:47:15 +0000 Subject: [PATCH] ICU-6967 Changed if statement to check for the same sign for the values instead of the exact number. X-SVN-Rev: 26144 --- icu4c/source/test/cintltst/putiltst.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/icu4c/source/test/cintltst/putiltst.c b/icu4c/source/test/cintltst/putiltst.c index 66d3764a76..cd6ed1e740 100644 --- a/icu4c/source/test/cintltst/putiltst.c +++ b/icu4c/source/test/cintltst/putiltst.c @@ -305,15 +305,15 @@ static void TestCompareVersions() u_versionFromString(v2, v2str); got = memcmp(v1, v2, sizeof(UVersionInfo)); invgot = memcmp(v2, v1, sizeof(UVersionInfo)); /* Opposite */ - if(got==op) { + if((got < 0 && op < 0) || (got > 0 && op > 0)) { log_verbose("%d: %s %s %s, OK\n", (j/3), v1str, opstr, v2str); } else { - log_err("%d: %s %s %s: wanted %d got %d\n", (j/3), v1str, opstr, v2str, op, got); + log_err("%d: %s %s %s: wanted values of the same sign, %d got %d\n", (j/3), v1str, opstr, v2str, op, got); } - if(invgot==invop) { + if((invgot > 0 && invop > 0) || (invgot < 0 && invop < 0)) { log_verbose("%d: %s (%d) %s, OK (inverse)\n", (j/3), v2str, invop, v1str); } else { - log_err("%d: %s (%d) %s: wanted %d got %d\n", (j/3), v2str, invop, v1str, invop, invgot); + log_err("%d: %s (%d) %s: wanted values of the same sign, %d got %d\n", (j/3), v2str, invop, v1str, invop, invgot); } } }