diff options
author | Simon Josefsson <simon@josefsson.org> | 2010-04-21 23:18:24 +0200 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2010-04-21 23:18:24 +0200 |
commit | 742c31198cc4061a13a1dc3f46cc5f9c9be2741d (patch) | |
tree | 2c4d805005fdf743d305c8b5576d7ca5b4bcc0a1 /lib/gl/tests | |
parent | d153ee5f4519f27e32c8ef637a1f67539ede4af2 (diff) | |
download | gnutls-742c31198cc4061a13a1dc3f46cc5f9c9be2741d.tar.gz |
Update gnulib files.
Diffstat (limited to 'lib/gl/tests')
-rw-r--r-- | lib/gl/tests/test-stdbool.c | 5 | ||||
-rw-r--r-- | lib/gl/tests/test-stdint.c | 1 | ||||
-rw-r--r-- | lib/gl/tests/test-vasprintf.c | 20 |
3 files changed, 24 insertions, 2 deletions
diff --git a/lib/gl/tests/test-stdbool.c b/lib/gl/tests/test-stdbool.c index 560e0e534d..fcb534de4c 100644 --- a/lib/gl/tests/test-stdbool.c +++ b/lib/gl/tests/test-stdbool.c @@ -46,11 +46,12 @@ struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; -#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>. */ +#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>, at least, +not for all compilers. */ char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; -#endif char f[(_Bool) 0.0 == false ? 1 : -1]; +#endif char g[true]; char h[sizeof (_Bool)]; #if 0 /* See above. */ diff --git a/lib/gl/tests/test-stdint.c b/lib/gl/tests/test-stdint.c index 9cec2e2f80..d64057a256 100644 --- a/lib/gl/tests/test-stdint.c +++ b/lib/gl/tests/test-stdint.c @@ -22,6 +22,7 @@ #define DO_PEDANTIC 0 #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* likewise */ #include <stdint.h> #include "verify.h" diff --git a/lib/gl/tests/test-vasprintf.c b/lib/gl/tests/test-vasprintf.c index e5dc3cd3d3..e5676f4a9f 100644 --- a/lib/gl/tests/test-vasprintf.c +++ b/lib/gl/tests/test-vasprintf.c @@ -56,6 +56,16 @@ test_vasprintf () ASSERT (strcmp (result, "12345") == 0); free (result); } + + for (repeat = 0; repeat <= 8; repeat++) + { + char *result; + int retval = my_asprintf (&result, "%08lx", 12345); + ASSERT (retval == 8); + ASSERT (result != NULL); + ASSERT (strcmp (result, "00003039") == 0); + free (result); + } } static void @@ -72,6 +82,16 @@ test_asprintf () ASSERT (strcmp (result, "12345") == 0); free (result); } + + for (repeat = 0; repeat <= 8; repeat++) + { + char *result; + int retval = asprintf (&result, "%08lx", 12345); + ASSERT (retval == 8); + ASSERT (result != NULL); + ASSERT (strcmp (result, "00003039") == 0); + free (result); + } } int |