# HG changeset patch # User Paul Eggert # Date 1424508213 28800 # Node ID dd6f9e7b674a10806f20a68e9749c05ce6021c59 # Parent b941bb9e9efb18b25c6c1219e7ad41cea47ac5bc vasnprintf-posix-tests: use consistent test * tests/test-vasnprintf-posix.c (test_function): Use "<" in assert instead of "<=", for consistency with other tests. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-02-21 Paul Eggert + + vasnprintf-posix-tests: use consistent test + * tests/test-vasnprintf-posix.c (test_function): + Use "<" in assert instead of "<=", for consistency with other tests. + 2015-02-20 Paul Eggert printf, isinf, etc.: noncanonical != NaN diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c --- a/tests/test-vasnprintf-posix.c +++ b/tests/test-vasnprintf-posix.c @@ -1396,7 +1396,7 @@ my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { /* Pseudo-Infinity. */ @@ -1407,7 +1407,7 @@ my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { /* Pseudo-Zero. */ @@ -1418,7 +1418,7 @@ my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { /* Unnormalized number. */ @@ -1429,7 +1429,7 @@ my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { /* Pseudo-Denormal. */ @@ -1440,7 +1440,7 @@ my_asnprintf (NULL, &length, "%Lf %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } #endif @@ -2374,7 +2374,7 @@ my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { @@ -2386,7 +2386,7 @@ my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } /* asnprintf should print something even for noncanonical values. */ @@ -2398,7 +2398,7 @@ my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { /* Pseudo-Infinity. */ @@ -2409,7 +2409,7 @@ my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { /* Pseudo-Zero. */ @@ -2420,7 +2420,7 @@ my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { /* Unnormalized number. */ @@ -2431,7 +2431,7 @@ my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } { /* Pseudo-Denormal. */ @@ -2442,7 +2442,7 @@ my_asnprintf (NULL, &length, "%Le %d", x.value, 33, 44, 55); ASSERT (result != NULL); ASSERT (length == strlen (result)); - ASSERT (3 <= length && strcmp (result + length - 3, " 33") == 0); + ASSERT (3 < length && strcmp (result + length - 3, " 33") == 0); free (result); } #endif