[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] vasnprintf-posix-tests: use consistent test
From: |
Paul Eggert |
Subject: |
[PATCH] vasnprintf-posix-tests: use consistent test |
Date: |
Sat, 21 Feb 2015 00:44:28 -0800 |
* tests/test-vasnprintf-posix.c (test_function):
Use "<" in assert instead of "<=", for consistency with other tests.
---
ChangeLog | 6 ++++++
tests/test-vasnprintf-posix.c | 24 ++++++++++++------------
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ee4e33b..ffd51be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-21 Paul Eggert <address@hidden>
+
+ 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 <address@hidden>
printf, isinf, etc.: noncanonical != NaN
diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c
index 4573a9c..bf36f1f 100644
--- a/tests/test-vasnprintf-posix.c
+++ b/tests/test-vasnprintf-posix.c
@@ -1396,7 +1396,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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 @@ test_function (char * (*my_asnprintf) (char *, size_t *,
const char *, ...))
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
--
2.1.0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] vasnprintf-posix-tests: use consistent test,
Paul Eggert <=