Mercurial > hg > octave-nkf > gnulib-hg
changeset 17928:dd6f9e7b674a
vasnprintf-posix-tests: use consistent test
* tests/test-vasnprintf-posix.c (test_function):
Use "<" in assert instead of "<=", for consistency with other tests.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sat, 21 Feb 2015 00:43:33 -0800 |
parents | b941bb9e9efb |
children | 7f19e7f2afa2 |
files | ChangeLog tests/test-vasnprintf-posix.c |
diffstat | 2 files changed, 18 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-02-21 Paul Eggert <eggert@cs.ucla.edu> + + 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 <eggert@cs.ucla.edu> printf, isinf, etc.: noncanonical != NaN
--- 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