* tests/macros.h (CONTINUE_AFTER_ASSERT): New macro.
(test_exit_status): New variable.
(ASSERT, ASSERT_NO_STDIO): If CONTINUE_AFTER_ASSERT is 1, set
test_exit_status instead of aborting.
* tests/**/test-*.{c,h,cc} (main): Instead of exiting with exit code 0,
exit with exit code test_exit_status.
* tests/test-spawn-pipe-child.c: Undefine CONTINUE_AFTER_ASSERT.
* tests/uninorm/test-nf*.c: Include macros.h.
* tests/uninorm/test-u32-nf*-big.c: Likewise.
* tests/random*.c: Define NO_MAIN_HERE.
+2024-05-18 Bruno Haible <bruno@clisp.org>
+
+ tests: Support showing all assertion failures, not just the first one.
+ * tests/macros.h (CONTINUE_AFTER_ASSERT): New macro.
+ (test_exit_status): New variable.
+ (ASSERT, ASSERT_NO_STDIO): If CONTINUE_AFTER_ASSERT is 1, set
+ test_exit_status instead of aborting.
+ * tests/**/test-*.{c,h,cc} (main): Instead of exiting with exit code 0,
+ exit with exit code test_exit_status.
+ * tests/test-spawn-pipe-child.c: Undefine CONTINUE_AFTER_ASSERT.
+ * tests/uninorm/test-nf*.c: Include macros.h.
+ * tests/uninorm/test-u32-nf*-big.c: Likewise.
+ * tests/random*.c: Define NO_MAIN_HERE.
+
2024-05-18 Paul Eggert <eggert@cs.ucla.edu>
byteswap: pacify GCC 4.4.7 and older
clear_cache (start, end);
ASSERT (f () == 2);
- return 0;
+ return test_exit_status;
}
# endif
#endif
+/* Define NO_MAIN_HERE before including this file, if this compilation unit
+ does not contain a main() function. */
+
+/* Optionally define CONTINUE_AFTER_ASSERT to 1 before including this file,
+ if you wish execution to continue after an ASSERT or ASSERT_NO_STDIO
+ failure. */
+#ifndef CONTINUE_AFTER_ASSERT
+# define CONTINUE_AFTER_ASSERT 0
+#endif
+
/* Define ASSERT_STREAM before including this file if ASSERT must
target a stream other than stderr. */
#ifndef ASSERT_STREAM
# define ASSERT_STREAM stderr
#endif
+/* Exit status of the test.
+ Initialized to EXIT_SUCCESS.
+ Set to EXIT_FAILURE when an ASSERT or ASSERT_NO_STDIO fails. */
+/* To satisfy the "one definition rule", we define the variable in the
+ compilation unit that contains the main() function. */
+#ifdef NO_MAIN_HERE
+extern int volatile test_exit_status;
+#else
+int volatile test_exit_status = EXIT_SUCCESS;
+#endif
+
/* ASSERT (condition);
verifies that the specified condition is fulfilled. If not, a message
is printed to ASSERT_STREAM if defined (defaulting to stderr if
fprintf (ASSERT_STREAM, "%s:%d: assertion '%s' failed\n", \
__FILE__, __LINE__, #expr); \
fflush (ASSERT_STREAM); \
- abort (); \
+ if (CONTINUE_AFTER_ASSERT) \
+ test_exit_status = EXIT_FAILURE; \
+ else \
+ abort (); \
} \
} \
while (0)
WRITE_TO_STDERR (": assertion '"); \
WRITE_TO_STDERR (#expr); \
WRITE_TO_STDERR ("' failed\n"); \
- abort (); \
+ if (CONTINUE_AFTER_ASSERT) \
+ test_exit_status = EXIT_FAILURE; \
+ else \
+ abort (); \
} \
} \
while (0)
#include <config.h>
/* Specification. */
+#define NO_MAIN_HERE
#include "macros.h"
/* Some numbers in the interval [0,1). */
#include <config.h>
/* Specification. */
+#define NO_MAIN_HERE
#include "macros.h"
/* Some numbers in the interval [0,1). */
#include <config.h>
/* Specification. */
+#define NO_MAIN_HERE
#include "macros.h"
/* Some numbers in the interval [0,1). */
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
{
test_access (access);
- return 0;
+ return test_exit_status;
}
y = acos (x);
ASSERT (y >= 0.9272952180 && y <= 0.9272952181);
- return 0;
+ return test_exit_status;
}
y = acosf (x);
ASSERT (y >= 0.9272951f && y <= 0.9272953f);
- return 0;
+ return test_exit_status;
}
y = acosl (x);
ASSERT (y >= 0.9272952180L && y <= 0.9272952181L);
- return 0;
+ return test_exit_status;
}
/* Check that alignfree is a no-op on null pointers. */
alignfree (NULL);
- return 0;
+ return test_exit_status;
}
CHECK_ALIGNED (static_struct2_alignas);
CHECK_ALIGNED (static_struct3_alignas);
CHECK_ALIGNED (static_struct4_alignas);
- return 0;
+ return test_exit_status;
#endif
}
aligned32_free (aligned32_blocks[i]);
}
- return 0;
+ return test_exit_status;
}
free (aligned64_blocks[i]);
}
- return 0;
+ return test_exit_status;
#else
fputs ("Skipping test: function 'aligned_alloc' does not exist\n", stderr);
return 77;
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_areadlink (areadlink_with_size, true);
+ int result = test_areadlink (areadlink_with_size, true);
+ return (result ? result : test_exit_status);
}
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_areadlink (do_areadlink, true);
+ int result = test_areadlink (do_areadlink, true);
+ return (result ? result : test_exit_status);
}
}
ASSERT (close (dfd) == 0);
- return result;
+ return (result ? result : test_exit_status);
}
}
ASSERT (close (dfd) == 0);
- return result;
+ return (result ? result : test_exit_status);
}
argmatch_backup_usage (stdout);
- return 0;
+ return test_exit_status;
}
if (failure_count)
return 1;
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
free (src);
}
- return 0;
+ return test_exit_status;
}
free (contents);
}
- return 0;
+ return test_exit_status;
}
gl_list_free (values);
}
- return 0;
+ return test_exit_status;
}
gl_list_free (values);
}
- return 0;
+ return test_exit_status;
}
test_update (GL_ARRAY_OSET);
- return 0;
+ return test_exit_status;
}
gl_oset_free (set2);
}
- return 0;
+ return test_exit_status;
}
y = asin (x);
ASSERT (y >= 0.6435011087 && y <= 0.6435011088);
- return 0;
+ return test_exit_status;
}
y = asinf (x);
ASSERT (y >= 0.6435011f && y <= 0.6435013f);
- return 0;
+ return test_exit_status;
}
y = asinl (x);
ASSERT (y >= 0.6435011087L && y <= 0.6435011088L);
- return 0;
+ return test_exit_status;
}
free (expected_transform);
- return 0;
+ return test_exit_status;
}
printf ("Sent %u signals. Received %u signals. Done after %u mutations.\n",
num_signals_sent, num_signals_arrived, num_mutations);
- exit (0);
+ exit (test_exit_status);
/*NOTREACHED*/
}
printf ("Sent %u signals. Received %u signals. Done after %u mutations.\n",
num_signals_sent, num_signals_arrived, num_mutations);
- exit (0);
+ exit (test_exit_status);
/*NOTREACHED*/
}
y = atan (x);
ASSERT (y >= 0.5404195002 && y <= 0.5404195003);
- return 0;
+ return test_exit_status;
}
z = atan2 (y, x);
ASSERT (z >= -0.9272952181 && z <= -0.9272952180);
- return 0;
+ return test_exit_status;
}
z = atan2f (y, x);
ASSERT (z >= -0.9272953f && z <= -0.92729515f);
- return 0;
+ return test_exit_status;
}
y = atanf (x);
ASSERT (y >= 0.5404194f && y <= 0.5404196f);
- return 0;
+ return test_exit_status;
}
y = atanl (x);
ASSERT (y >= 0.5404195002L && y <= 0.5404195003L);
- return 0;
+ return test_exit_status;
}
free (contents);
}
- return 0;
+ return test_exit_status;
}
gl_omap_free (map2);
}
- return 0;
+ return test_exit_status;
}
test_update (GL_AVLTREE_OSET);
- return 0;
+ return test_exit_status;
}
free (contents);
}
- return 0;
+ return test_exit_status;
}
ok = base32_decode_alloc_ctx (NULL, "FZ======FY======", 16, &p, &len);
ASSERT (!ok);
- return 0;
+ return test_exit_status;
}
ok = base64_decode_alloc_ctx (NULL, "TWF=TWE=", 8, &p, &len);
ASSERT (!ok);
- return 0;
+ return test_exit_status;
}
break;
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (rotr64 (16045690984503098046ULL, 63) == 13644637895296644477ULL);
#endif /* UINT64_MAX */
- return 0;
+ return test_exit_status;
}
compare (BITSET_VARIABLE, BITSET_GREEDY);
bitset_stats_dump (stderr);
- return 0;
+ return test_exit_status;
}
ASSERT (tim >= now - 157680000);
ASSERT (tim <= now + 604800);
- return 0;
+ return test_exit_status;
}
But on musl libc, the bytes 0x80..0xFF map to U+DF80..U+DFFF. */
ASSERT (wc == c || wc == 0xDF00 + c);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (btoc32 (c) == c);
for (c = 0xA0; c < 0x100; c++)
ASSERT (btoc32 (c) != WEOF);
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (btoc32 (c) == c);
for (c = 0x80; c < 0x100; c++)
ASSERT (btoc32 (c) == WEOF);
- return 0;
+ return test_exit_status;
}
return 1;
But on musl libc, the bytes 0x80..0xFF map to U+DF80..U+DFFF. */
ASSERT (wc == c || wc == 0xDF00 + c);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (btowc (c) == c);
for (c = 0xA0; c < 0x100; c++)
ASSERT (btowc (c) != WEOF);
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (btowc (c) == c);
for (c = 0x80; c < 0x100; c++)
ASSERT (btowc (c) == WEOF);
- return 0;
+ return test_exit_status;
}
return 1;
test_bswap_eval_once ();
test_bswap_double ();
- return 0;
+ return test_exit_status;
}
setlocale (LC_ALL, "ja_JP.EUC-JP");
test_all ();
- return 0;
+ return test_exit_status;
}
ASSERT (!strcmp (buf, "0.1"));
}
- return 0;
+ return test_exit_status;
}
ASSERT (!strcmp (buf, "0.1"));
}
- return 0;
+ return test_exit_status;
}
fail |= quarter_test ();
fail |= errno_test ();
fail |= locales_test (english);
- return fail;
+ return (fail ? fail : test_exit_status);
}
ASSERT (!strcmp (s, "1."));
}
- return 0;
+ return test_exit_status;
}
ASSERT (c_strcasecmp ("TURK\304\260SH", "turkish") > 0);
#endif
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
ASSERT (c_strncasecmp ("TURK\304\260SH", "turkish", 7) > 0);
#endif
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
{
test_function (c_strtod);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
{
test_function (c_strtof);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
{
test_function (c_strtold);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
free (s);
}
- return 0;
+ return test_exit_status;
}
ASSERT (!strcmp (s, "1."));
}
- return 0;
+ return test_exit_status;
}
free (s);
}
- return 0;
+ return test_exit_status;
}
ASSERT (c32_apply_mapping ((char32_t) 0, desc) == 0);
ASSERT (c32_apply_mapping (WEOF, desc) == WEOF);
- return 0;
+ return test_exit_status;
}
ASSERT (! c32_apply_type_test ((char32_t) '\0', desc));
ASSERT (! c32_apply_type_test (WEOF, desc));
- return 0;
+ return test_exit_status;
}
desc = c32_get_mapping ("toupper");
ASSERT (desc != (c32_mapping_t) 0);
- return 0;
+ return test_exit_status;
}
desc = c32_get_type_test ("print");
ASSERT (desc != (c32_type_test_t) 0);
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\330", 1);
ASSERT (is != 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\201\241", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\237\065", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\330", 1);
ASSERT (is != 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\201\241", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\237\065", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\267", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\241\243", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\200\240", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\231\060", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\240", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\241\241", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\271", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\243\261", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\200\263", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\232\071", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\241\241", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (is == 0);
#endif
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
ASSERT (is == 0);
#endif
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\377", 1);
ASSERT (is != 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\201\241", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\237\065", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (is == 0);
#endif
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
ASSERT (is == 0);
#endif
}
- return 0;
+ return test_exit_status;
}
ASSERT (is != 0);
is = for_character ("`", 1);
ASSERT (is != 0);
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\337", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\243\355", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (is == 0);
#endif
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
ASSERT (is == 0);
#endif
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\267", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\241\242", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\200\240", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\231\060", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\377", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
ASSERT (is != 0);
#endif
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\201\241", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\237\065", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\271", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\243\341", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\201\201", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\234\063", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
}
if (result == 77)
- {
- fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
- codepage);
- }
- return result;
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ return (result ? result : test_exit_status);
}
#else
{
case '1':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
check_character (input + 1, 1);
check_character (input + 2, 1);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
check_character (input + 3, 2);
check_character (input + 5, 4);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is EUC-JP. */
check_character (input + 3, 2);
check_character (input + 5, 2);
}
- return 0;
+ return test_exit_status;
case '5':
/* Locale encoding is GB18030. */
check_character (input + 3, 4);
check_character (input + 7, 4);
}
- return 0;
+ return test_exit_status;
}
return 1;
return 1;
}
- return 0;
+ return test_exit_status;
}
return 1;
return 1;
}
- return 0;
+ return test_exit_status;
}
return 1;
return 1;
}
- return 0;
+ return test_exit_status;
}
return 1;
ASSERT (w == 4);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (mb.nbytes == 1);
ASSERT (memcmp (mb.buf, "\377", 1) == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
ASSERT (mb.nbytes == 2);
ASSERT (memcmp (mb.buf, "\243\347", 2) == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (mb.nbytes == 4);
ASSERT (memcmp (mb.buf, "\363\240\201\241", 4) == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
ASSERT (mb.nbytes == 4);
ASSERT (memcmp (mb.buf, "\323\066\237\065", 4) == 0);
}
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (memcmp (mb.buf, "\377", 1) == 0);
#endif
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
ASSERT (memcmp (mb.buf, "\243\307", 2) == 0);
#endif
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (mb.nbytes == 4);
ASSERT (memcmp (mb.buf, "\363\240\201\241", 4) == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
ASSERT (mb.nbytes == 4);
ASSERT (memcmp (mb.buf, "\323\066\237\065", 4) == 0);
}
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
ASSERT (a == 42);
- return 0;
+ return test_exit_status;
}
test_once ();
printf (" OK\n"); fflush (stdout);
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (remove (BASE) == 0);
ASSERT (remove ("ise") == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (remove (BASE) == 0);
ASSERT (remove ("ise") == 0);
- return 0;
+ return test_exit_status;
}
free (contents);
}
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
ASSERT (ceil (Infinityd ()) == Infinityd ());
ASSERT (ceil (- Infinityd ()) == - Infinityd ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnand (ceil (NaNd ())));
- return 0;
+ return test_exit_status;
}
>> NUM_HIGHBITS);
error |= check (janus.f);
}
- return (error ? 1 : 0);
+ return (error ? 1 : test_exit_status);
}
ASSERT (ceilf (Infinityf ()) == Infinityf ());
ASSERT (ceilf (- Infinityf ()) == - Infinityf ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnanf (my_ceilf (NaNf ())));
- return 0;
+ return test_exit_status;
}
>> NUM_HIGHBITS);
error |= check (janus.f);
}
- return (error ? 1 : 0);
+ return (error ? 1 : test_exit_status);
}
ASSERT (ceill (Infinityl ()) == Infinityl ());
ASSERT (ceill (- Infinityl ()) == - Infinityl ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnanl (ceill (NaNl ())));
- return 0;
+ return test_exit_status;
}
{
ASSERT (chdir ("/") == 0);
- return 0;
+ return test_exit_status;
}
unlink (BASE "link");
}
- return 0;
+ return test_exit_status;
}
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_chown (chown, true);
+ int result = test_chown (chown, true);
+ return (result ? result : test_exit_status);
}
ASSERT (close (fd) == 0);
ASSERT (unlink (file) == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
printf (" OK\n"); fflush (stdout);
#endif
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
close (fd2);
close (fd1);
- return 0;
+ return test_exit_status;
}
else
copy_file_preserving (file1, file2);
- return 0;
+ return test_exit_status;
}
ASSERT (z == 0.0);
ASSERT (memcmp (&z, &zero, sizeof z) != 0);
- return 0;
+ return test_exit_status;
}
ASSERT (z == 0.0f);
ASSERT (memcmp (&z, &zero, sizeof z) != 0);
- return 0;
+ return test_exit_status;
}
ASSERT (z == 0.0L);
ASSERT (memcmp (&z, &zero, sizeof z) != 0);
- return 0;
+ return test_exit_status;
}
y = cos (x);
ASSERT (y >= 0.8253356149 && y <= 0.8253356150);
- return 0;
+ return test_exit_status;
}
y = cosf (x);
ASSERT (y >= 0.8253355f && y <= 0.8253357f);
- return 0;
+ return test_exit_status;
}
y = cosh (x);
ASSERT (y >= 1.185465218 && y <= 1.185465219);
- return 0;
+ return test_exit_status;
}
y = coshf (x);
ASSERT (y >= 1.1854652f && y <= 1.1854653f);
- return 0;
+ return test_exit_status;
}
y = cosl (x);
ASSERT (y >= 0.8253356149L && y <= 0.8253356150L);
- return 0;
+ return test_exit_status;
}
TEST_COUNT_LEADING_ZEROS (count_leading_zeros_ll, unsigned long long int,
ULLONG_BIT, ULLONG_MAX, 1ULL);
- return 0;
+ return test_exit_status;
}
TEST_COUNT_ONE_BITS (count_one_bits_ll, unsigned long long int,
ULLONG_BIT, ULLONG_MAX, 1ULL);
- return 0;
+ return test_exit_status;
}
TEST_COUNT_TRAILING_ZEROS (count_trailing_zeros_ll, unsigned long long int,
ULLONG_BIT, ULLONG_MAX, 1ULL);
- return 0;
+ return test_exit_status;
}
ASSERT (unlink (BASE "file") == 0);
ASSERT (unlink (BASE "e.exe") == 0);
- return 0;
+ return test_exit_status;
}
di_set_free (dis);
- return 0;
+ return test_exit_status;
}
ASSERT (close (dfd) == 0);
#endif
- return 0;
+ return test_exit_status;
}
int fd = dirfd (d);
ASSERT (fd >= 0);
- return 0;
+ return test_exit_status;
#endif
}
main (int argc, char *argv[])
{
test_function (dprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (dprintf);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
ASSERT (close (fd) == 0);
ASSERT (unlink (witness) == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
ASSERT (close (fd) == 0);
ASSERT (unlink (file) == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (unlink (file) == 0);
}
- return 0;
+ return test_exit_status;
}
return 77;
}
- return 0;
+ return test_exit_status;
}
#else
}
intseq_free (&s);
- return 0;
+ return test_exit_status;
}
test_convert_eval_once ();
test_convert_double ();
- return 0;
+ return test_exit_status;
}
y = erf (x);
ASSERT (y >= 0.6038560908 && y <= 0.6038560909);
- return 0;
+ return test_exit_status;
}
y = erfc (x);
ASSERT (y >= 0.3961439091 && y <= 0.3961439092);
- return 0;
+ return test_exit_status;
}
/* Test error() function with nonzero STATUS. */
error (4, 0, "fatal error");
- return 0;
+ return test_exit_status;
}
{
test_access (euidaccess);
- return 0;
+ return test_exit_status;
}
printf ("\nTruncated stack trace:\n"); fflush (stdout);
test_backtrace (1);
- return 0;
+ return test_exit_status;
}
default:
ASSERT (false);
}
- return 0;
+ return test_exit_status;
}
}
}
+ if (test_exit_status)
+ return test_exit_status;
+
#if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, scripts - even with '#!' marker - are not executable.
Only .bat and .cmd files are. */
ASSERT (unlink (DATA_FILENAME) == 0);
- return 0;
+ return test_exit_status;
#endif
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
test_heap ();
test_stack ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
unlink (BASE "link1");
unlink (BASE "file");
- return 0;
+ return test_exit_status;
}
if (ret != 0)
goto fail;
- return 0;
+ return test_exit_status;
fail:
return ret;
}
free (cwd);
- return 0;
+ return test_exit_status;
}
ASSERT (unlink (BASE "file") == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (unlink (BASE "file") == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
ASSERT (close (dfd) == 0);
/* FIXME - add additional tests of dfd not at current directory. */
- return result1 | result2;
+ int result = result1 | result2;
+ return (result ? result : test_exit_status);
}
/* Clean up. */
ASSERT (remove (BASE) == 0);
- return 0;
+ return test_exit_status;
}
int
main (void)
{
- return test_open (open, true);
+ int result = test_open (open, true);
+ return (result ? result : test_exit_status);
}
/* Test whether F_DUPFD_CLOEXEC is effective. */
ASSERT (fcntl (1, F_DUPFD_CLOEXEC, 10) >= 0);
+ if (test_exit_status)
+ return test_exit_status;
#if defined _WIN32 && !defined __CYGWIN__
return _execl ("./test-fcntl", "./test-fcntl", "child", NULL);
#else
ASSERT (unlink (file) == 0);
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (dup2 (fd, fd) == -1);
ASSERT (errno == EBADF);
- return 0;
+ return test_exit_status;
}
ASSERT (chdir ("..") == 0);
ASSERT (unlink (BASE "dir/file") == 0);
ASSERT (rmdir (BASE "dir") == 0);
- return result1 | result2 | result3;
+ int result = result1 | result2 | result3;
+ return (result ? result : test_exit_status);
}
a = 0; b = a / a;
}
- return 0;
+ return test_exit_status;
#endif
}
a = 0; b = a / a;
}
- return 0;
+ return test_exit_status;
#endif
}
}
# endif
- return 0;
+ return test_exit_status;
#endif
}
}
# endif
- return 0;
+ return test_exit_status;
#endif
}
env1 has trapping on FE_INVALID enabled, this should trap. */
ASSERT (feupdateenv (&env1) == 0);
- return 0;
+ return test_exit_status;
}
#else
/* Check that it's clear in both units. */
ASSERT (fetestexcept (FE_INVALID) == 0);
- return 0;
+ return test_exit_status;
}
a = 1.0; b = a + a;
al = 1.0L; bl = al + al;
- return 0;
+ return test_exit_status;
}
#else
ASSERT (fetestexceptflag (&saved_flags_2, FE_INVALID) == FE_INVALID);
ASSERT (fetestexceptflag (&saved_flags_2, FE_OVERFLOW) == 0);
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
break;
}
- return 0;
+ return test_exit_status;
}
#else
feraiseexcept (exception);
}
- return 0;
+ return test_exit_status;
}
#else
ASSERT (fetestexcept (FE_INEXACT) == FE_INEXACT);
- return 0;
+ return test_exit_status;
}
a = 1.0; b = a + a;
al = 1.0L; bl = al + al;
- return 0;
+ return test_exit_status;
}
#else
ASSERT (feenableexcept (0) == uint_to_exceptions (c));
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
skip:
fputs ("Skipping test: trapping floating-point exceptions are not supported on this machine.\n", stderr);
test_tonearest ();
ASSERT (fegetround () == FE_TONEAREST);
- return 0;
+ return test_exit_status;
}
/* Clean up. */
unlink ("test-fflush.txt");
- return 0;
+ return test_exit_status;
}
c = fgetc (stdin);
ASSERT (c == '/');
- return 0;
+ return test_exit_status;
case '2':
/* Check fflush after a non-backup ungetc() call. This is case 2a in
c = fgetc (stdin);
ASSERT (c == '/');
- return 0;
+ return test_exit_status;
}
return 1;
ASSERT (ffs (7U << i) == i + 1);
ASSERT (ffs (-7U << i) == i + 1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ffsl (7UL << i) == i + 1);
ASSERT (ffsl (-7UL << i) == i + 1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ffsll (7ULL << i) == i + 1);
ASSERT (ffsll (-7ULL << i) == i + 1);
}
- return 0;
+ return test_exit_status;
}
/* Clean up. */
unlink (filename);
- return 0;
+ return test_exit_status;
}
printf ("no\n");
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (test_filevercmp (*j, *i) == 0);
}
- return 0;
+ return test_exit_status;
}
END_LONG_DOUBLE_ROUNDING ();
}
- return 0;
+ return test_exit_status;
}
#else
ASSERT (close (fd) == 0);
ASSERT (unlink (file) == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (floor (Infinityd ()) == Infinityd ());
ASSERT (floor (- Infinityd ()) == - Infinityd ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnand (floor (NaNd ())));
- return 0;
+ return test_exit_status;
}
>> NUM_HIGHBITS);
error |= check (janus.f);
}
- return (error ? 1 : 0);
+ return (error ? 1 : test_exit_status);
#else
fprintf (stderr, "Skipping test: no 64-bit integer type available\n");
return 77;
ASSERT (floorf (Infinityf ()) == Infinityf ());
ASSERT (floorf (- Infinityf ()) == - Infinityf ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnanf (my_floorf (NaNf ())));
- return 0;
+ return test_exit_status;
}
>> NUM_HIGHBITS);
error |= check (janus.f);
}
- return (error ? 1 : 0);
+ return (error ? 1 : test_exit_status);
}
ASSERT (floorl (Infinityl ()) == Infinityl ());
ASSERT (floorl (- Infinityl ()) == - Infinityl ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnanl (floorl (NaNl ())));
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function (fma);
- return 0;
+ return test_exit_status;
}
{
test_function (fma);
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function (fmaf);
- return 0;
+ return test_exit_status;
}
{
test_function (fmaf);
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function (fmal);
- return 0;
+ return test_exit_status;
}
test_function (fmal);
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
}
if (result == 77)
- {
- fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
- codepage);
- }
- return result;
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ return (result ? result : test_exit_status);
}
#else
{
case '1':
/* C or POSIX locale. */
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (fnmatch ("H\366hLe", "H\326hle", FNM_CASEFOLD) == 0);
#endif
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
}
#endif
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is EUC-JP. */
}
#endif
- return 0;
+ return test_exit_status;
case '5':
/* Locale encoding is GB18030. */
}
#endif
- return 0;
+ return test_exit_status;
}
return 1;
ASSERT (unlink (BASE "file") == 0);
ASSERT (unlink (BASE "binary") == 0);
- return 0;
+ return test_exit_status;
}
int
main (void)
{
- return test_fopen ();
+ int result = test_fopen ();
+ return (result ? result : test_exit_status);
}
int
main (void)
{
- return test_fopen ();
+ int result = test_fopen ();
+ return (result ? result : test_exit_status);
}
fflush (stdout);
ASSERT (__fpending (stdout) == 0);
- exit (0);
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (fprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (fprintf);
- return 0;
+ return test_exit_status;
}
}
remove (TESTFILE);
- return 0;
+ return test_exit_status;
skip:
fprintf (stderr, "Skipping test: prerequisite file operations failed.\n");
/* Clean up. */
unlink (filename);
- return 0;
+ return test_exit_status;
}
/* Clean up. */
unlink (filename);
- return 0;
+ return test_exit_status;
}
if (fclose (fp))
goto skip;
- return 0;
+ return test_exit_status;
skip:
fprintf (stderr, "Skipping test: file operations failed.\n");
/* Free memory allocated during ungetc(). */
fclose (stdin);
- return 0;
+ return test_exit_status;
}
ASSERT (!freading (fp));
ASSERT (fclose (fp) == 0);
ASSERT (remove (TESTFILE) == 0);
- return 0;
+ return test_exit_status;
}
/* Free memory allocated during ungetc(). */
fclose (stdin);
- return 0;
+ return test_exit_status;
}
ASSERT (freadptrbufsize (stdin) != 0);
}
- return 0;
+ return test_exit_status;
}
free (buf3);
free (buf1);
- return 0;
+ return test_exit_status;
}
#endif
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (freopen ("/dev/null", "w+", fp) == fp);
ASSERT (STDERR_FILENO < fileno (fp));
- return 0;
+ return test_exit_status;
}
/* Clean up. */
unlink (filename);
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
ASSERT (fseek (stdin, 0, SEEK_END) == 0);
ASSERT (!feof (stdin));
}
- return 0;
+ return test_exit_status;
}
ASSERT (fseeko (stdin, 0, SEEK_END) == 0);
ASSERT (!feof (stdin));
}
- return 0;
+ return test_exit_status;
}
ASSERT (fclose (fp) == 0);
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
if (result == 77)
fputs ("skipping test: symlinks not supported on this file system\n",
stderr);
- return result;
+ return (result ? result : test_exit_status);
}
ASSERT (check_fstrcmp ("George Bush", "Abraham Lincoln", 2./13.));
ASSERT (check_fstrcmp ("George Bush", "George \"Bugs\" Moran", 2./3.));
- return 0;
+ return test_exit_status;
}
ASSERT (unlink (file) == 0);
- return 0;
+ return test_exit_status;
}
if (argc == 1)
{
ASSERT (ftell (stdin) == -1);
- return 0;
+ return test_exit_status;
}
/* mingw ftell is unreliable on text mode input. */
ASSERT (ftell (stdin) == ch + 10);
#endif
- return 0;
+ return test_exit_status;
}
/* The file's contents is now "foogarsh!". */
remove (TESTFILE);
- return 0;
+ return test_exit_status;
skip:
fprintf (stderr, "Skipping test: prerequisite file operations failed.\n");
ASSERT (ftello (stdin) == ch + 10);
#endif
- return 0;
+ return test_exit_status;
}
/* The file's contents is now "foogarsh!". */
remove (TESTFILE);
- return 0;
+ return test_exit_status;
skip:
fprintf (stderr, "Skipping test: prerequisite file operations failed.\n");
}
}
- return 0;
+ return test_exit_status;
}
close (fd);
}
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (__func__, "main") == 0
|| strcmp (__func__, "<unknown function>") == 0);
- return 0;
+ return test_exit_status;
}
/* Clean up any trash from prior testsuite runs. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_futimens (futimens, true);
+ int result = test_futimens (futimens, true);
+ return (result ? result : test_exit_status);
}
if (fclose (fp))
goto skip;
- return 0;
+ return test_exit_status;
skip:
fprintf (stderr, "Skipping test: file operations failed.\n");
/* Clean up. */
unlink (filename);
- return 0;
+ return test_exit_status;
}
if (fclose (fp))
goto skip;
- return 0;
+ return test_exit_status;
skip:
fprintf (stderr, "Skipping test: file operations failed.\n");
#endif
ASSERT (value3 > value1);
- return 0;
+ return test_exit_status;
}
}
ASSERT (value3 > value1);
#endif
- return 0;
+ return test_exit_status;
}
}
free (pwd1);
free (pwd2);
- return 0;
+ return test_exit_status;
}
{
int err1 = test_abort_bug ();
int err2 = test_long_name ();
- return err1 * 10 + (err1 != 0 && err2 == 77 ? 0 : err2);
+ int result = err1 * 10 + (err1 != 0 && err2 == 77 ? 0 : err2);
+ return (result ? result : test_exit_status);
}
free (line);
fclose (f);
remove ("test-getdelim.txt");
- return 0;
+ return test_exit_status;
}
ASSERT (dup2 (0, getdtablesize() - 1) == getdtablesize () - 1);
ASSERT (dup2 (0, getdtablesize()) == -1);
- return 0;
+ return test_exit_status;
}
ASSERT (memcmp (buf1, buf2, sizeof (buf1)) != 0);
}
- return 0;
+ return test_exit_status;
}
printf ("%d\n", (int) groups[i]);
}
free (groups);
- return 0;
+ return test_exit_status;
}
free (line);
fclose (f);
remove ("test-getline.txt");
- return 0;
+ return test_exit_status;
}
#endif
test_getlogin_result (buf, err);
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (hugebuf, buf) == 0);
}
- return 0;
+ return test_exit_status;
}
fclose (f);
remove ("test-getndelim2.txt");
- return 0;
+ return test_exit_status;
}
ASSERT (fclose (stderr) == 0);
ASSERT (remove (TEST_GETOPT_TMP_NAME) == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (neg_ret == pos_ret);
}
- return 0;
+ return test_exit_status;
}
ASSERT (neg_ret == pos_ret);
}
- return 0;
+ return test_exit_status;
}
ASSERT (neg_ret == pos_ret);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
return 77;
}
- return 0;
+ return test_exit_status;
}
ASSERT (spent_utime + spent_stime > 10000U);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ntohs (addr.sin_port) != 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
test_clobber ();
test_consistency ();
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
first_pass ();
second_pass ();
- return 0;
+ return test_exit_status;
}
ASSERT (sizeof (g.gl_pathv));
ASSERT (sizeof (g.gl_offs));
- return 0;
+ return test_exit_status;
}
globfree (&g);
}
- return 0;
+ return test_exit_status;
}
nanosleep (&duration, NULL);
}
- return 0;
+ return test_exit_status;
}
#else
#endif
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
test_destructive_update ();
test_iterator ();
- return 0;
+ return test_exit_status;
}
hash_free (ht);
}
- return 0;
+ return test_exit_status;
}
gl_map_free (map2);
}
- return 0;
+ return test_exit_status;
}
gl_set_free (set2);
}
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
ASSERT (o == 8);
ASSERT (i_ring_empty (&ir));
- return 0;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
#endif /* HAVE_ICONV */
- return 0;
+ return test_exit_status;
}
# endif
#endif
- return 0;
+ return test_exit_status;
}
}
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
ASSERT (result == 23);
}
- return 0;
+ return test_exit_status;
}
ASSERT (result.rem == -3);
}
- return 0;
+ return test_exit_status;
}
default:
ASSERT (false);
}
- return 0;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
ino_map_free (ino_map);
- return 0;
+ return test_exit_status;
}
ASSERT (integer_length (-5U << i) == NBITS);
ASSERT (integer_length (-7U << i) == NBITS);
}
- return 0;
+ return test_exit_status;
}
ASSERT (integer_length_l (-5UL << i) == NBITS);
ASSERT (integer_length_l (-7UL << i) == NBITS);
}
- return 0;
+ return test_exit_status;
}
ASSERT (integer_length_ll (-5ULL << i) == NBITS);
ASSERT (integer_length_ll (-7ULL << i) == NBITS);
}
- return 0;
+ return test_exit_status;
}
CHECK_REMAINDER (37*39u - 1, -39, true);
CHECK_REMAINDER (LONG_MAX, -INT_MAX, false);
- return 0;
+ return test_exit_status;
}
CK (uintmax_t, umaxtostr);
CK (intmax_t, imaxtostr);
free (b);
- return 0;
+ return test_exit_status;
}
/* snprintf doesn't accept %ju; skip this test. */
}
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (unlink (file) == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (!isblank (c) == !(c == ' ' || c == '\t'));
ASSERT (!isblank (EOF));
- return 0;
+ return test_exit_status;
}
test_isfinitef ();
test_isfinited ();
test_isfinitel ();
- return 0;
+ return test_exit_status;
}
test_isinff ();
test_isinfd ();
test_isinfl ();
- return 0;
+ return test_exit_status;
}
test_float ();
test_double ();
test_long_double ();
- return 0;
+ return test_exit_status;
}
/* Signalling NaN. */
ASSERT (isnand (SNaNd ()));
#endif
- return 0;
+ return test_exit_status;
}
/* Signalling NaN. */
ASSERT (isnanf (SNaNf ()));
#endif
- return 0;
+ return test_exit_status;
}
#undef NWORDS
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (iswblank (L'\t'));
ASSERT (!iswblank (L'\n'));
- return 0;
+ return test_exit_status;
}
ASSERT (! iswctype (L'\0', desc));
ASSERT (! iswctype (WEOF, desc));
- return 0;
+ return test_exit_status;
}
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\271", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\243\261", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\200\263", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\232\071", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (is != 0);
is = for_character ("`", 1);
ASSERT (is != 0);
- return 0;
+ return test_exit_status;
}
return 1;
{
case '0':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
is = for_character ("\271", 1);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is EUC-JP. */
is = for_character ("\243\341", 2);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
is = for_character ("\363\240\201\201", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is GB18030. */
is = for_character ("\323\066\234\063", 4);
ASSERT (is == 0);
}
- return 0;
+ return test_exit_status;
}
y = j0 (x);
ASSERT (y >= -0.4025564102 && y <= -0.4025564101);
- return 0;
+ return test_exit_status;
}
y = j1 (x);
ASSERT (y >= 0.0128210029 && y <= 0.0128210030);
- return 0;
+ return test_exit_status;
}
y = jn (10, x);
ASSERT (y >= 0.0001211233 && y <= 0.0001211234);
- return 0;
+ return test_exit_status;
}
unlink (BASE "link");
}
- return 0;
+ return test_exit_status;
}
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_lchown (lchown, true);
+ int result = test_lchown (lchown, true);
+ return (result ? result : test_exit_status);
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
/* Γ(x) = 1.4891922488... */
ASSERT (y >= 0.3982338580 && y <= 0.3982338581);
- return 0;
+ return test_exit_status;
}
ASSERT (mpz_get_si (four) == 4);
mpz_clear (four);
- return 0;
+ return test_exit_status;
}
/* Remove any garbage left from previous partial runs. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_link (link, true);
+ int result = test_link (link, true);
+ return (result ? result : test_exit_status);
}
ASSERT (unlink (BASE "link4") == 0);
ASSERT (unlink (BASE "link5") == 0);
free (cwd);
- return result;
+
+ return (result ? result : test_exit_status);
}
free (contents);
}
- return 0;
+ return test_exit_status;
}
free (contents);
}
- return 0;
+ return test_exit_status;
}
gl_map_free (map2);
}
- return 0;
+ return test_exit_status;
}
gl_set_free (set2);
}
- return 0;
+ return test_exit_status;
}
list2.free ();
list1.free ();
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
ASSERT (l->int_n_sep_by_space == CHAR_MAX);
}
- return 0;
+ return test_exit_status;
}
test_locale_name_environ ();
test_locale_name_default ();
- return 0;
+ return test_exit_status;
}
nanosleep (&duration, NULL);
}
- return 0;
+ return test_exit_status;
}
#else
#endif
}
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
default:
return 1;
}
- return 0;
+ return test_exit_status;
}
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_lstat_func (do_lstat, true);
+ int result = test_lstat_func (do_lstat, true);
+ return (result ? result : test_exit_status);
}
ASSERT (errno == ENOMEM);
}
- return 0;
+ return test_exit_status;
}
map1.free ();
- return 0;
+ return test_exit_status;
}
/* Check the value of FP_ILOGBNAN. */
ASSERT (FP_ILOGBNAN == INT_MIN || FP_ILOGBNAN == INT_MAX);
- return 0;
+ return test_exit_status;
}
mbf_getc (next, mbstdin);
ASSERT (mb_iseof (next));
- return 0;
+ return test_exit_status;
}
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
test_iso_8859_1 (mbmemcasecmp, true);
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8, locale is not Turkish. */
test_utf_8 (mbmemcasecmp, false);
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is UTF-8, locale is Turkish. */
test_utf_8 (mbmemcasecmp, true);
- return 0;
+ return test_exit_status;
}
return 1;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
test_iso_8859_1 (mbmemcasecoll_hard, false);
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8, locale is not Turkish. */
test_utf_8 (mbmemcasecoll_hard, false);
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is UTF-8, locale is Turkish. */
test_utf_8 (mbmemcasecoll_hard, true);
- return 0;
+ return test_exit_status;
}
return 1;
}
if (result == 77)
- {
- fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
- codepage);
- }
- return result;
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ return (result ? result : test_exit_status);
}
#else
ASSERT (mbsinit (&state));
}
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (ret == 1);
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (ret == 1);
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is EUC-JP. */
ASSERT (ret == 1);
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '5':
/* Locale encoding is GB18030. */
ASSERT (ret == 1);
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
}
return 1;
}
if (result == 77)
- {
- fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
- codepage);
- }
- return result;
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ return (result ? result : test_exit_status);
}
#else
ASSERT (mbsinit (&state));
}
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (wc == 'r');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (wc == '!');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is EUC-JP. */
ASSERT (wc == '>');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '5':
/* Locale encoding is GB18030. */
ASSERT (wc == '!');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
}
return 1;
ASSERT (c32 == 0);
}
- return 0;
+ return test_exit_status;
}
}
if (result == 77)
- {
- fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
- codepage);
- }
- return result;
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ return (result ? result : test_exit_status);
}
#else
ASSERT (mbsinit (&state));
}
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (wc == 'r');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (wc == '!');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is EUC-JP. */
ASSERT (wc == '>');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '5':
/* Locale encoding is GB18030. */
ASSERT (wc == '!');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
}
return 1;
}
if (result == 77)
- {
- fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
- codepage);
- }
- return result;
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ return (result ? result : test_exit_status);
}
#else
ASSERT (mbsinit (&state));
}
}
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
ASSERT (wc == 'r');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
ASSERT (wc == 'r');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is EUC-JP. */
ASSERT (wc == '>');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
case '5':
/* Locale encoding is GB18030. */
ASSERT (wc == 'r');
ASSERT (mbsinit (&state));
}
- return 0;
+ return test_exit_status;
}
return 1;
ASSERT (mbscasecmp ("turkish", "TURK\304\260SH") == 0);
ASSERT (mbscasecmp ("TURK\304\260SH", "turkish") == 0);
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
ASSERT (result == NULL);
}
- return 0;
+ return test_exit_status;
}
ASSERT (mbscasestr (input, "TB\304\260L\304\260S\304\260 \304\260m\304\260n\304\260") == input + 1); /* TBİLİSİ İmİnİ */
}
- return 0;
+ return test_exit_status;
}
ASSERT (result == NULL);
}
- return 0;
+ return test_exit_status;
}
ASSERT (mbscspn (input, "\303") == 14); /* invalid multibyte sequence */
}
- return 0;
+ return test_exit_status;
}
ASSERT (!mbsinit (&state));
}
- return 0;
+ return test_exit_status;
}
ASSERT (mbsncasecmp ("turkish", "TURK\304\260SH", 7) == 0);
ASSERT (mbsncasecmp ("TURK\304\260SH", "turkish", 7) == 0);
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
return 1;
}
}
- return 0;
+ return test_exit_status;
}
return 1;
ASSERT (mbspbrk (input, "\303") == NULL); /* invalid multibyte sequence */
}
- return 0;
+ return test_exit_status;
}
ASSERT (mbspcasecmp (string, "turkish") == string + 8);
}
- return 0;
+ return test_exit_status;
}
ASSERT (result == input + 5);
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
return 1;
}
}
- return 0;
+ return test_exit_status;
}
return 1;
ASSERT (mbsspn (input, "\303") == 0); /* invalid multibyte sequence */
}
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
ASSERT (result == NULL);
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
return 1;
}
}
- return 0;
+ return test_exit_status;
}
return 1;
}
}
- return 0;
+ return test_exit_status;
}
"\x0d\x70\x06\xcd\x05\x5e\x94\xcf\x61\x45\x87\xe1\xd2\xae\x0c\x8e",
"\xec\x99\x67\x9b\xff\xc0\xf9\xb0\x6d\x18\x30\x6b\x06\xd6\x56\x23");
- return 0;
+ return test_exit_status;
}
free (aligned64_blocks[i]);
}
- return 0;
+ return test_exit_status;
}
#else
}
}
- return 0;
+ return test_exit_status;
}
free (input);
- return 0;
+ return test_exit_status;
}
free (input);
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (memcoll0 ("x\0""1", 4, "x\0""2", 4) < 0);
ASSERT (memcoll0 ("x\0""2", 4, "x\0""1", 4) > 0);
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
free (input);
- return 0;
+ return test_exit_status;
}
test_heap ();
test_stack ();
- return 0;
+ return test_exit_status;
}
/* Clean up any trash from prior testsuite runs. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_mkdir (mkdir, true);
+ int result = test_mkdir (mkdir, true);
+ return (result ? result : test_exit_status);
}
ASSERT (rmdir (BASE "dir1") == 0);
ASSERT (rmdir (BASE "dir2") == 0);
- return result;
+ return (result ? result : test_exit_status);
}
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_mkfifo (mkfifo, true);
+ int result = test_mkfifo (mkfifo, true);
+ return (result ? result : test_exit_status);
}
ASSERT (close (dfd) == 0);
- return 0;
+ return test_exit_status;
}
/* We can only portably test creation of fifos. Anything else
requires root privileges and knowledge of device numbers. */
- return test_mkfifo (do_mknod, true);
+ int result = test_mkfifo (do_mknod, true);
+ return (result ? result : test_exit_status);
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
printf (" OK\n"); fflush (stdout);
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (!fetestexcept (FE_INVALID));
}
- return 0;
+ return test_exit_status;
}
#endif
resultd = nand + 42.0;
resultl = nanl + 42.0L;
- return 0;
+ return test_exit_status;
}
#else
}
#endif
- return 0;
+ return test_exit_status;
}
y = nextafter (x, x);
ASSERT (y == x);
- return 0;
+ return test_exit_status;
}
ASSERT (strlen (nl_langinfo (YESEXPR)) > 0);
ASSERT (strlen (nl_langinfo (NOEXPR)) > 0);
- return 0;
+ return test_exit_status;
}
return 77;
}
- return 0;
+ return test_exit_status;
#else
fputs ("Skipping test: uselocale() not available\n", stderr);
return 77;
main_reader_loop (test, PIPE_DATA_BLOCK_SIZE, STDIN_FILENO);
- return 0;
+ return test_exit_status;
}
ASSERT (err == 0);
}
- return exitcode;
+ return (exitcode ? exitcode : test_exit_status);
}
main_reader_loop (test, SOCKET_DATA_BLOCK_SIZE, client_socket);
- return 0;
+ return test_exit_status;
}
ASSERT (err == 0);
}
- return exitcode;
+ return (exitcode ? exitcode : test_exit_status);
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
fail |= locales_test (french);
#endif
}
- return fail;
+ return (fail ? fail : test_exit_status);
}
main ()
{
varargs_callee ("type", nullptr, "foo", nullptr);
+
+ return test_exit_status;
}
{
varargs_callee ("type", nullptr, "foo", nullptr);
- return 0;
+ return test_exit_status;
}
{
test_obstack_vprintf ();
test_obstack_printf ();
- return 0;
+ return test_exit_status;
}
map1.free ();
- return 0;
+ return test_exit_status;
}
ASSERT (a == 42);
- return 0;
+ return test_exit_status;
}
int
main (void)
{
- return test_open (open, true);
+ int result = test_open (open, true);
+ return (result ? result : test_exit_status);
}
ASSERT (unlink (witness) == 0);
ASSERT (close (dfd) == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (openat (dfd, ".", O_RDONLY) == STDIN_FILENO);
ASSERT (close (dfd) == 0);
}
- return result;
+ return (result ? result : test_exit_status);
}
set1.free ();
- return 0;
+ return test_exit_status;
}
&& result.tv_nsec == 123456789);
}
- return 0;
+ return test_exit_status;
}
ASSERT (fd == -1);
ASSERT (errno == ENOTCONN);
- return 0;
+ return test_exit_status;
}
#else
errno = 0;
ASSERT (fclose (stderr) == 0);
ASSERT (remove (BASE ".tmp") == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (physmem_total () >= physmem_available ());
ASSERT (physmem_available () >= 4 * 1024 * 1024);
- return 0;
+ return test_exit_status;
}
free (input);
- return 0;
+ return test_exit_status;
}
fflush (stdout);
}
- return 0;
+ return test_exit_status;
}
free (input);
- return 0;
+ return test_exit_status;
}
fflush (stdout);
}
- return 0;
+ return test_exit_status;
}
ASSERT (!is_nonblocking (fd[0]));
ASSERT (!is_nonblocking (fd[1]));
- return 0;
+ return test_exit_status;
}
ASSERT (close (fd[1]) == 0);
}
- return 0;
+ return test_exit_status;
}
result += test (test_accept_first, "General socket test with fork");
result += test (test_pipe, "Pipe test");
- exit (result);
+ return (result ? result : test_exit_status);
}
status = pclose (fp);
ASSERT (WIFEXITED (status));
ASSERT (!WEXITSTATUS (status));
- return 0;
+
+ return test_exit_status;
}
}
}
free (cmd);
- return 0;
+ return test_exit_status;
}
free (aligned64_blocks[i]);
}
- return 0;
+ return test_exit_status;
#else
fputs ("Skipping test: function 'aligned_alloc' does not exist\n", stderr);
return 77;
ASSERT (close (master) == 0);
ASSERT (close (slave) == 0);
- return 0;
+ return test_exit_status;
}
/* Clean up data file. */
unlink (DATA_FILENAME);
- return 0;
+ return test_exit_status;
}
posix_spawn_file_actions_destroy (&actions);
- return 0;
+ return test_exit_status;
}
posix_spawn_file_actions_destroy (&actions);
- return 0;
+ return test_exit_status;
}
posix_spawn_file_actions_destroy (&actions);
- return 0;
+ return test_exit_status;
}
posix_spawn_file_actions_destroy (&actions);
- return 0;
+ return test_exit_status;
}
posix_spawn_file_actions_destroy (&actions);
- return 0;
+ return test_exit_status;
}
/* Clean up data file. */
unlink (DATA_FILENAME);
- return 0;
+ return test_exit_status;
}
main (void)
{
unsigned int i;
- int fail = 0;
char curr_year_str[30];
struct tm *tm;
time_t t_now;
{
printf ("%s return value mismatch: got %d, expected %d\n",
T[i].in, !!ok, T[i].valid);
- fail = 1;
+ test_exit_status = EXIT_FAILURE;
continue;
}
{
printf ("%s mismatch (-: actual; +:expected)\n-%12ld\n+%12ld\n",
T[i].in, (long) t_out, (long) t_exp);
- fail = 1;
+ test_exit_status = EXIT_FAILURE;
}
}
- return fail;
+ return test_exit_status;
}
/*
z = pow (x, y);
ASSERT (z >= 728.9999999 && z <= 729.0000001);
- return 0;
+ return test_exit_status;
}
z = powf (x, y);
ASSERT (z >= 728.999f && z <= 729.001f);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
ASSERT (mantissa == my_ldexp (x, - exp));
}
- return 0;
+ return test_exit_status;
}
ASSERT (mantissa == my_ldexp (x, - exp));
}
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (printf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (printf);
- return 0;
+ return test_exit_status;
}
/* Test whether __attribute__ (__format__ (...)) still works. */
ASSERT (priv_set_remove_linkdir () == -1);
#endif
- return 0;
+ return test_exit_status;
}
int
main (void)
{
- return test_function (my_select);
+ int result = test_function (my_select);
+ return (result ? result : test_exit_status);
}
printf (" OK\n"); fflush (stdout);
#endif
- return 0;
+ return test_exit_status;
}
#else
printf (" OK\n"); fflush (stdout);
#endif
- return 0;
+ return test_exit_status;
}
#else
ASSERT (a == 42);
- return 0;
+ return test_exit_status;
}
test_once ();
printf (" OK\n"); fflush (stdout);
- return 0;
+ return test_exit_status;
}
#else
test_rwlock ();
printf (" OK\n"); fflush (stdout);
- return 0;
+ return test_exit_status;
}
#else
test_pthread_spin ();
printf (" OK\n"); fflush (stdout);
- return 0;
+ return test_exit_status;
}
#else
/* Check that worker_thread_func () has finished executing. */
ASSERT (work_done);
- return 0;
+ return test_exit_status;
}
else
{
test_tss_racecheck ();
printf (" OK\n"); fflush (stdout);
- return 0;
+ return test_exit_status;
}
#else
before the call to pthread_sigmask() returns." */
ASSERT (sigint_occurred == 1);
- return 0;
+ return test_exit_status;
}
#else
from "gcc -fsanitize=thread". */
ASSERT (pthread_join (killer_thread, NULL) == 0);
- return 0;
+ return test_exit_status;
}
#else
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (getenv ("TEST_VAR") == NULL);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
quotearg_free ();
- return 0;
+ return test_exit_status;
}
compare_strings (use_quotearg_colon, &locale_results[1].group3, false);
quotearg_free ();
- return 0;
+ return test_exit_status;
}
}
static _Noreturn void
handler (_GL_UNUSED int sig)
{
- _exit (0);
+ _exit (test_exit_status);
}
int
}
/* Fail if none of the numbers were larger than RAND_MAX / 2. */
- return !n_big;
+ if (!n_big)
+ return 1;
+ return test_exit_status;
}
for (alignment = 0; alignment < sizeof (int32_t); alignment++)
if (test_failed (alignment))
return 1;
- return 0;
+ return test_exit_status;
}
free (input);
}
- return 0;
+ return test_exit_status;
}
free (contents);
}
- return 0;
+ return test_exit_status;
}
gl_omap_free (map2);
}
- return 0;
+ return test_exit_status;
}
test_update (GL_RBTREE_OSET);
- return 0;
+ return test_exit_status;
}
free (contents);
}
- return 0;
+ return test_exit_status;
}
ASSERT (!test_read_file (RF_SENSITIVE));
ASSERT (!test_read_file (RF_BINARY | RF_SENSITIVE));
- return 0;
+ return test_exit_status;
}
/* Clean up. */
unlink (filename);
- return 0;
+ return test_exit_status;
}
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_readlink (readlink, true);
+ int result = test_readlink (readlink, true);
+ return (result ? result : test_exit_status);
}
if (result == 77)
fputs ("skipping test: symlinks not supported on this file system\n",
stderr);
- return result;
+ return (result ? result : test_exit_status);
}
ASSERT ( ! ferror (stdin));
- return 0;
+ return test_exit_status;
}
free (entries);
- return 0;
+ return test_exit_status;
}
}
free (p);
- return 0;
+ return test_exit_status;
}
free (p);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
{
test_bre ();
test_ere ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
ASSERT (remove (BASE "link") == 0);
ASSERT (remove (BASE "file") == 0);
- return 0;
+ return test_exit_status;
}
/* Remove any garbage left from previous partial runs. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_rename (rename, true);
+ int result = test_rename (rename, true);
+ return (result ? result : test_exit_status);
}
ASSERT (errno == ENOENT);
free (cwd);
- if (result)
+ if (result == 77)
fputs ("skipping test: symlinks not supported on this file system\n",
stderr);
- return result;
+ return (result ? result : test_exit_status);
}
ASSERT (rmdir (BASE "sub2") == 0);
free (cwd);
- if (result)
+ if (result == 77)
fputs ("skipping test: symlinks not supported on this file system\n",
stderr);
- return result;
+ return (result ? result : test_exit_status);
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
else
{
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
else
{
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
else
{
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_rmdir_func (rmdir, true);
+ int result = test_rmdir_func (rmdir, true);
+ return (result ? result : test_exit_status);
}
ASSERT (round (Infinityd ()) == Infinityd ());
ASSERT (round (- Infinityd ()) == - Infinityd ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnand (round (NaNd ())));
- return 0;
+ return test_exit_status;
}
ASSERT (roundf (Infinityf ()) == Infinityf ());
ASSERT (roundf (- Infinityf ()) == - Infinityf ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnanf (roundf (NaNf ())));
- return 0;
+ return test_exit_status;
}
ASSERT (roundl (Infinityl ()) == Infinityl ());
ASSERT (roundl (- Infinityl ()) == - Infinityl ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnanl (roundl (NaNl ())));
- return 0;
+ return test_exit_status;
}
FREE (p);
ASSERT (p == NULL);
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
scratch_buffer_free (&buf);
}
- return 0;
+ return test_exit_status;
}
int
main (void)
{
- return test_function (select);
+ int result = test_function (select);
+ return (result ? result : test_exit_status);
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
set1.free ();
- return 0;
+ return test_exit_status;
}
set_acl (file, -1, mode);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EINVAL);
#endif
- return 0;
+ return test_exit_status;
}
/* restore the original name. */
ASSERT (sethostname (origname, strlen (origname)) == 0);
- return 0;
+ return test_exit_status;
}
free (name1);
free (name2);
- return 0;
+ return test_exit_status;
}
ASSERT (x == 0.0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (x == 0.0f);
}
- return 0;
+ return test_exit_status;
}
ASSERT (x == 0.0L);
}
- return 0;
+ return test_exit_status;
}
ASSERT (x == 0.0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (x == 0.0f);
}
- return 0;
+ return test_exit_status;
}
ASSERT (x == 0.0L);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
free (result);
}
- return 0;
+ return test_exit_status;
}
"\x9c\x04\xcd\x63\x72\x07\x7e\x9b\x11\xf7\x0c\xa1\x11\xc9\x80\x7d\xc7\x13\x7e\x4b",
"\x91\xab\x6b\x1b\x8d\x29\x25\x3c\xcb\x8d\xce\xb7\x7a\x25\x26\x2c\x92\xc9\x22\x09");
- return 0;
+ return test_exit_status;
}
"\xb4\x7c\xc0\xf1\x04\xb6\x2d\x4c\x7c\x30\xbc\xd6\x8f\xd8\xe6\x76\x13\xe2\x87\xdc\x4a\xd8\xc3\x10\xef\x10\xcb\xad\xea\x9c\x43\x80",
"\xe5\x19\x95\xff\x0b\xc4\x95\xcf\x49\xdd\x31\x42\x0a\x6b\xe0\x6b\x38\xef\xef\x43\xab\xa6\xf4\x76\x64\x32\x99\x4a\x47\x1a\x0f\xb5");
- return 0;
+ return test_exit_status;
}
"\x02\x0d\xa0\xf4\xd8\xa4\xc8\xbf\xbc\x98\x27\x40\x27\x74\x00\x61\xd7\xdf\x52\xee\x07\x09\x1e\xd6\x59\x5a\x08\x3e\x0f\x45\x32\x7b\xbe\x59\x42\x43\x12\xd8\x6f\x21\x8b\x74\xed\x2e\x25\x50\x7a\xba\xf5\xc7\xa5\xfc\xf4\xca\xfc\xf9\x53\x8b\x70\x58\x08\xfd\x55\xec",
"\x38\x34\x58\xf3\xde\x68\x70\x33\x0c\xa4\xd4\x71\x4d\x0f\x41\xc5\xed\xc9\xf4\x67\x3e\x19\x0f\x87\x2b\x53\x72\x00\xa8\x35\x73\xf7\x0b\xf1\xf2\x0d\x9a\xa8\xd6\x08\x65\x2f\xe2\x28\xbd\x2d\x0c\xd5\xd6\xd4\xd3\xb2\x84\x3e\x32\x32\x5d\x62\x54\x7b\x39\xfd\x47\x04");
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
test_sig2str ();
test_str2sig ();
- return 0;
+ return test_exit_status;
}
ASSERT (sigabbrev_np (-714) == NULL);
- return 0;
+ return test_exit_status;
}
ASSERT (old_sa.sa_handler == SIG_IGN);
ASSERT (raise (SIGABRT) == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (sigdescr_np (-714) == NULL);
- return 0;
+ return test_exit_status;
}
test_signbitf ();
test_signbitd ();
test_signbitl ();
- return 0;
+ return test_exit_status;
}
before the call to sigprocmask() returns." */
ASSERT (sigint_occurred == 1);
- return 0;
+ return test_exit_status;
}
#else
}
}
- return 0;
+ return test_exit_status;
}
#else
y = sin (x);
ASSERT (y >= 0.5646424733 && y <= 0.5646424734);
- return 0;
+ return test_exit_status;
}
y = sinf (x);
ASSERT (y >= 0.5646424f && y <= 0.5646426f);
- return 0;
+ return test_exit_status;
}
y = sinh (x);
ASSERT (y >= 0.6366535821 && y <= 0.6366535822);
- return 0;
+ return test_exit_status;
}
y = sinhf (x);
ASSERT (y >= 0.6366535f && y <= 0.6366537f);
- return 0;
+ return test_exit_status;
}
y = sinl (x);
ASSERT (y >= 0.5646424733L && y <= 0.5646424734L);
- return 0;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
break;
}
- return 0;
+ return test_exit_status;
}
#else
main (int argc, char *argv[])
{
test_function (snprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (snprintf);
- return 0;
+ return test_exit_status;
}
ASSERT (retval == strlen (result));
}
- return 0;
+ return test_exit_status;
}
#define BACKUP_STDERR_FILENO 10
#define ASSERT_STREAM myerr
+#undef CONTINUE_AFTER_ASSERT
#include "macros.h"
static FILE *myerr;
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
test_pipe (argv[1], test >= 4);
- return 0;
+ return test_exit_status;
}
}
}
+ if (test_exit_status != EXIT_SUCCESS)
+ return test_exit_status;
+
#if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, scripts - even with '#!' marker - are not executable.
Only .bat and .cmd files are. */
ASSERT (fclose (fp) == 0);
}
- return 0;
+ return test_exit_status;
#endif
}
main (int argc, char *argv[])
{
test_function (sprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (sprintf);
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
{
test_function ();
- return 0;
+ return test_exit_status;
}
test_function ();
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (string_stack_empty (string_stack));
string_stack_destroy (string_stack);
- return EXIT_SUCCESS;
+ return test_exit_status;
}
test_birthtime (statinfo, modtimes, birthtimes);
cleanup (0);
- return 0;
+ return test_exit_status;
}
int
main (void)
{
- return test_stat_func (do_stat, true);
+ int result = test_stat_func (do_stat, true);
+ return (result ? result : test_exit_status);
}
}
#endif
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
free (input);
- return 0;
+ return test_exit_status;
}
ASSERT (*str);
ASSERT (errno == 0 || errno == EINVAL);
- return 0;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (strerrorname_np (20200830) == NULL);
ASSERT (strerrorname_np (-714) == NULL);
- return 0;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (s == NULL);
}
- return 0;
+ return test_exit_status;
}
ASSERT (memcmp (ret, "[[Hello world!]]", 16 + 1) == 0);
}
- return 0;
+ return test_exit_status;
}
close (fd3);
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
while (j--);
}
- return 0;
+ return test_exit_status;
}
ASSERT (str != (char *) -1);
ASSERT (strlen (str));
- return 0;
+ return test_exit_status;
}
free (haystack);
}
- return 0;
+ return test_exit_status;
}
{
test_function (strtod);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
{
test_function (strtof);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
{
test_function (strtold);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (errno == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (strverscmp (b, a) < 0);
}
- return 0;
+ return test_exit_status;
}
test_fopen_supersede (true, false);
test_fopen_supersede (true, true);
- return 0;
+ return test_exit_status;
}
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_symlink (symlink, true);
+ int result = test_symlink (symlink, true);
+ return (result ? result : test_exit_status);
}
if (result == 77)
fputs ("skipping test: symlinks not supported on this file system\n",
stderr);
- return result;
+ return (result ? result : test_exit_status);
}
#define EXPECTED_DATA_FILE "t-sq-data.tmp"
-static int failed;
-
static void
check_one (enum system_command_interpreter interpreter, const char *prog,
const char *input)
{
fprintf (stderr, "for input = |%s|: system() command failed with status %d: %s\n",
input, exitcode, command);
- failed = 1;
+ test_exit_status = EXIT_FAILURE;
}
}
{
{
fprintf (stderr, "for input = |%s|: popen() command failed with status %d: %s\n",
input, exitcode, command);
- failed = 1;
+ test_exit_status = EXIT_FAILURE;
}
}
break;
{
fprintf (stderr, "for input = |%s|: CreateProcess() command failed with status %d: %s\n",
input, exitcode, command);
- failed = 1;
+ test_exit_status = EXIT_FAILURE;
}
}
else
{
fprintf (stderr, "for input = |%s|: GetExitCodeProcess failed, GetLastError() = %u\n",
input, GetLastError ());
- failed = 1;
+ test_exit_status = EXIT_FAILURE;
}
}
else
{
fprintf (stderr, "for input = |%s|: WaitForSingleObject failed\n",
input);
- failed = 1;
+ test_exit_status = EXIT_FAILURE;
}
CloseHandle (pinfo.hProcess);
}
{
fprintf (stderr, "for input = |%s|: CreateProcess failed, GetLastError() = %u\n",
input, GetLastError ());
- failed = 1;
+ test_exit_status = EXIT_FAILURE;
}
}
break;
/* Clean up. */
unlink (EXPECTED_DATA_FILE);
- return failed;
+ return test_exit_status;
}
y = tan (x);
ASSERT (y >= 0.6841368083 && y <= 0.6841368084);
- return 0;
+ return test_exit_status;
}
y = tanf (x);
ASSERT (y >= 0.6841368f && y <= 0.6841369f);
- return 0;
+ return test_exit_status;
}
y = tanh (x);
ASSERT (y >= 0.5370495669 && y <= 0.5370495670);
- return 0;
+ return test_exit_status;
}
y = tanhf (x);
ASSERT (y >= 0.5370495f && y <= 0.5370497f);
- return 0;
+ return test_exit_status;
}
y = tanl (x);
ASSERT (y >= 0.6841368083L && y <= 0.6841368084L);
- return 0;
+ return test_exit_status;
}
unlink (filename2);
}
- return 0;
+ return test_exit_status;
}
/* Check that worker_thread_func () has finished executing. */
ASSERT (work_done);
- return 0;
+ return test_exit_status;
}
else
{
/* Check that worker_thread_func () has finished executing. */
ASSERT (work_done);
- return 0;
+ return test_exit_status;
}
else
{
/* Check that worker_thread_func () has finished executing. */
ASSERT (work_done);
- return 0;
+ return test_exit_status;
}
else
{
test_thread_local ();
printf (" OK\n"); fflush (stdout);
- return 0;
+ return test_exit_status;
}
#else
tt3 = time (NULL);
ASSERT (tt3 >= tv2.tv_sec);
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (tt2 <= ts3.tv_sec);
ASSERT (ts3.tv_sec <= tt4);
- return 0;
+ return test_exit_status;
}
? 0 < ts.tv_nsec && ts.tv_nsec < 1000000000
: ts.tv_sec == 1 && ts.tv_nsec == 0);
- return 0;
+ return test_exit_status;
}
positive_NaN_with_payload (1729)
};
int n = SIZEOF (x);
- int result = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (!(!!TOTALORDER (&x[i].value, &x[j].value) == (i <= j)))
{
fprintf (stderr, "Failed: i=%d j=%d\n", i, j);
- result = 1;
+ test_exit_status = EXIT_FAILURE;
}
- return result;
+ return test_exit_status;
}
positive_NaN_with_payload (1729)
};
int n = SIZEOF (x);
- int result = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
== ((i < n / 2 ? n - 1 - i : i) <= (j < n /2 ? n - 1 - j : j))))
{
fprintf (stderr, "Failed: i=%d j=%d\n", i, j);
- result = 1;
+ test_exit_status = EXIT_FAILURE;
}
- return result;
+ return test_exit_status;
}
ASSERT (towctrans ((wchar_t) 0, desc) == 0);
ASSERT (towctrans (WEOF, desc) == WEOF);
- return 0;
+ return test_exit_status;
}
{
case '1':
/* C or POSIX locale. */
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is UTF-8. */
ASSERT (strcmp (result, "\302\267foo") == 0);
free (result);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is GB18030. */
free (result);
}
#endif
- return 0;
+ return test_exit_status;
}
return 1;
ASSERT (trunc (Infinityd ()) == Infinityd ());
ASSERT (trunc (- Infinityd ()) == - Infinityd ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnand (trunc (NaNd ())));
- return 0;
+ return test_exit_status;
}
>> NUM_HIGHBITS);
error |= check (janus.f);
}
- return (error ? 1 : 0);
+ return (error ? 1 : test_exit_status);
}
/* Cleanup. */
ASSERT (unlink (BASE "file") == 0);
- return 0;
+ return test_exit_status;
}
ASSERT (truncf (Infinityf ()) == Infinityf ());
ASSERT (truncf (- Infinityf ()) == - Infinityf ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnanf (truncf (NaNf ())));
- return 0;
+ return test_exit_status;
}
>> NUM_HIGHBITS);
error |= check (janus.f);
}
- return (error ? 1 : 0);
+ return (error ? 1 : test_exit_status);
}
ASSERT (truncl (Infinityl ()) == Infinityl ());
ASSERT (truncl (- Infinityl ()) == - Infinityl ());
- return 0;
+ return test_exit_status;
}
/* NaNs. */
ASSERT (isnanl (truncl (NaNl ())));
- return 0;
+ return test_exit_status;
}
test_tss_racecheck ();
printf (" OK\n"); fflush (stdout);
- return 0;
+ return test_exit_status;
}
);
}
- return 0;
+ return test_exit_status;
}
printf ("uname -m = machine or cpu = %s\n", buf.machine);
}
- return 0;
+ return test_exit_status;
}
ASSERT (0);
}
- return 0;
+ return test_exit_status;
}
/* Remove any leftovers from a previous partial run. */
ignore_value (system ("rm -rf " BASE "*"));
- return test_unlink_func (unlink, true);
+ int result = test_unlink_func (unlink, true);
+ return (result ? result : test_exit_status);
}
if (result1 == 77)
fputs ("skipping test: symlinks not supported on this file system\n",
stderr);
- return result1;
+ return (result1 ? result1 : test_exit_status);
}
}
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EINVAL);
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (usleep (0) == 0);
- return 0;
+ return test_exit_status;
}
ignore_value (system ("rm -rf " BASE "*"));
result1 = test_utime (true);
- return result1;
+ return (result1 ? result1 : test_exit_status);
}
result3 = test_lutimens (lutimens, (result1 + result2) == 0);
/* We expect 0/0, 0/77, or 77/77, but not 77/0. */
ASSERT (result1 <= result3);
- return result1 | result2 | result3;
+ int result = result1 | result2 | result3;
+ return (result ? result : test_exit_status);
}
ASSERT (chdir ("..") == 0);
ASSERT (unlink (BASE "dir/file") == 0);
ASSERT (rmdir (BASE "dir") == 0);
- return result1 | result2;
+ int result = result1 | result2;
+ return (result ? result : test_exit_status);
}
{
test_vasnprintf ();
test_asnprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vasnprintf ();
test_asnprintf ();
- return 0;
+ return test_exit_status;
}
free (result);
}
- return 0;
+ return test_exit_status;
}
test_vasnprintf ();
test_asnprintf ();
- return 0;
+ return test_exit_status;
#else
fprintf (stderr, "Skipping test: not a glibc >= 2.3 system\n");
return 77;
{
test_vasnprintf ();
test_asnprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vasnwprintf ();
test_asnwprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vasnwprintf ();
test_asnwprintf ();
- return 0;
+ return test_exit_status;
}
free (result);
}
- return 0;
+ return test_exit_status;
}
test_vasnwprintf ();
test_asnwprintf ();
- return 0;
+ return test_exit_status;
#else
fprintf (stderr, "Skipping test: not a glibc >= 2.3 system\n");
return 77;
{
test_vasnwprintf ();
test_asnwprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vasprintf ();
test_asprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vasprintf ();
test_asprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vasprintf ();
test_asprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_fprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_fprintf);
- return 0;
+ return test_exit_status;
}
ASSERT (errno == EBADF);
}
- return 0;
+ return test_exit_status;
}
/* Test verror() function with nonzero STATUS. */
test_fatal ("fatal error");
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_fprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_fprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_printf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_printf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_snprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_snprintf);
- return 0;
+ return test_exit_status;
}
ASSERT (retval == strlen (result));
}
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_sprintf);
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_function (my_sprintf);
- return 0;
+ return test_exit_status;
}
}
if (result == 77)
- {
- fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
- codepage);
- }
- return result;
+ fprintf (stderr, "Skipping test: found no locale with codepage %d\n",
+ codepage);
+ return (result ? result : test_exit_status);
}
#else
{
case '1':
/* C locale; tested above. */
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
check_character (input + 1, 1);
check_character (input + 2, 1);
}
- return 0;
+ return test_exit_status;
case '3':
/* Locale encoding is UTF-8. */
check_character (input + 1, 2);
check_character (input + 3, 2);
}
- return 0;
+ return test_exit_status;
case '4':
/* Locale encoding is EUC-JP. */
check_character (input + 3, 2);
check_character (input + 5, 2);
}
- return 0;
+ return test_exit_status;
case '5':
/* Locale encoding is GB18030. */
check_character (input + 1, 2);
check_character (input + 3, 4);
}
- return 0;
+ return test_exit_status;
}
return 1;
}
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
return 1;
}
- return 0;
+ return test_exit_status;
}
return 1;
return 1;
}
- return 0;
+ return test_exit_status;
}
return 1;
free (haystack);
}
- return 0;
+ return test_exit_status;
}
ret = wcstok (NULL, delim, &ptr);
ASSERT (ret == NULL);
- return 0;
+ return test_exit_status;
}
desc = wctrans ("toupper");
ASSERT (desc != (wctrans_t) 0);
- return 0;
+ return test_exit_status;
}
ASSERT (towlower (e) == e);
ASSERT (towupper (e) == e);
- return 0;
+ return test_exit_status;
}
desc = wctype ("print");
ASSERT (desc != (wctype_t) 0);
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
free (pwd2);
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (wmemcmp (input2, input1, 1) > 0);
}
- return 0;
+ return test_exit_status;
}
/* Clean up. */
unlink (filename);
- return 0;
+ return test_exit_status;
}
main (_GL_UNUSED int argc, char *argv[])
{
test_function (xfprintf);
- return 0;
+ return test_exit_status;
}
free (result);
}
- return 0;
+ return test_exit_status;
}
main (_GL_UNUSED int argc, char *argv[])
{
test_function (xprintf);
- return 0;
+ return test_exit_status;
}
xstdopen ();
ASSERT (open ("Makefile", O_RDONLY) >= 3);
- return 0;
+ return test_exit_status;
}
free (s);
}
- return 0;
+ return test_exit_status;
}
free (ptr);
}
- return 0;
+ return test_exit_status;
}
test_xvasprintf ();
test_xasprintf ();
- return 0;
+ return test_exit_status;
}
y = y0 (x);
ASSERT (y >= 0.0645032466 && y <= 0.0645032467);
- return 0;
+ return test_exit_status;
}
y = y1 (x);
ASSERT (y >= 0.4141146893 && y <= 0.4141146894);
- return 0;
+ return test_exit_status;
}
y = yn (10, x);
ASSERT (y >= -284.4645273 && y <= -284.4645272);
- return 0;
+ return test_exit_status;
}
language = uc_locale_language ();
ASSERT (strcmp (language, expected) == 0);
- return 0;
+ return test_exit_status;
}
for (; c < 0x110000; c++)
ASSERT (MAP (c) == c);
- return 0;
+ return test_exit_status;
}
for (; c < 0x110000; c++)
ASSERT (!PREDICATE (c));
- return 0;
+ return test_exit_status;
}
test_ascii (u16_casecmp, UNINORM_NFD);
test_nonascii (u16_casecmp);
- return 0;
+ return test_exit_status;
}
on ASCII strings should behave like strcasecmp. */
test_ascii (u16_casecoll, UNINORM_NFC);
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casefolded_normalized, SIZEOF (casefolded_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
{
test_ascii (u16_is_cased);
- return 0;
+ return test_exit_status;
}
test_ascii (u16_is_casefolded);
test_nonascii (u16_is_casefolded);
- return 0;
+ return test_exit_status;
}
test_ascii (u16_is_lowercase);
test_nonascii (u16_is_lowercase);
- return 0;
+ return test_exit_status;
}
{
test_ascii (u16_is_titlecase);
- return 0;
+ return test_exit_status;
}
test_ascii (u16_is_uppercase);
test_nonascii (u16_is_uppercase);
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, NULL, casemapped, SIZEOF (casemapped)) == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casemapped_normalized, SIZEOF (casemapped_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casemapped_normalized, SIZEOF (casemapped_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
test_ascii (u32_casecmp, UNINORM_NFD);
test_nonascii (u32_casecmp);
- return 0;
+ return test_exit_status;
}
on ASCII strings should behave like strcasecmp. */
test_ascii (u32_casecoll, UNINORM_NFC);
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casefolded_normalized, SIZEOF (casefolded_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
{
test_ascii (u32_is_cased);
- return 0;
+ return test_exit_status;
}
test_ascii (u32_is_casefolded);
test_nonascii (u32_is_casefolded);
- return 0;
+ return test_exit_status;
}
test_ascii (u32_is_lowercase);
test_nonascii (u32_is_lowercase);
- return 0;
+ return test_exit_status;
}
{
test_ascii (u32_is_titlecase);
- return 0;
+ return test_exit_status;
}
test_ascii (u32_is_uppercase);
test_nonascii (u32_is_uppercase);
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, NULL, casemapped, SIZEOF (casemapped)) == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casemapped_normalized, SIZEOF (casemapped_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casemapped_normalized, SIZEOF (casemapped_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
test_ascii (u8_casecmp, UNINORM_NFD);
test_nonascii (u8_casecmp);
- return 0;
+ return test_exit_status;
}
on ASCII strings should behave like strcasecmp. */
test_ascii (u8_casecoll, UNINORM_NFC);
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casefolded_normalized, SIZEOF (casefolded_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
{
test_ascii (u8_is_cased);
- return 0;
+ return test_exit_status;
}
test_ascii (u8_is_casefolded);
test_nonascii (u8_is_casefolded);
- return 0;
+ return test_exit_status;
}
test_ascii (u8_is_lowercase);
test_nonascii (u8_is_lowercase);
- return 0;
+ return test_exit_status;
}
{
test_ascii (u8_is_titlecase);
- return 0;
+ return test_exit_status;
}
test_ascii (u8_is_uppercase);
test_nonascii (u8_is_uppercase);
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, NULL, casemapped, SIZEOF (casemapped)) == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casemapped_normalized, SIZEOF (casemapped_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check (input, SIZEOF (input), NULL, UNINORM_NFC, casemapped_normalized, SIZEOF (casemapped_normalized)) == 0);
}
- return 0;
+ return test_exit_status;
}
case '1':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
test_iso_8859_1 (ulc_casecmp);
- return 0;
+ return test_exit_status;
case '2':
/* Locale encoding is UTF-8. */
test_utf_8 (ulc_casecmp);
- return 0;
+ return test_exit_status;
}
return 1;
on ASCII strings should behave like strcasecmp. */
test_ascii (ulc_casecoll, UNINORM_NFC);
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (uc_bidi_class_byname ("X") < 0);
ASSERT (uc_bidi_class_byname ("") < 0);
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (uc_bidi_class_long_name (UC_BIDI_WS), "White Space") == 0);
ASSERT (uc_bidi_class_long_name (-1) == NULL);
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (uc_bidi_class_name (UC_BIDI_NSM), "NSM") == 0);
ASSERT (uc_bidi_class_name (-1) == NULL);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_bidi_class (0x05D7) == UC_BIDI_R);
ASSERT (uc_bidi_class ('7') == UC_BIDI_EN);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_is_bidi_class (c, uc_bidi_class (c)));
}
- return 0;
+ return test_exit_status;
}
ASSERT (hebrew_block != NULL);
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc_is_block (0x2A6D6, &b));
ASSERT (!uc_is_block (0x2A6D7, &b));
- return 0;
+ return test_exit_status;
}
ASSERT (uc_is_general_category ('7', ct));
ASSERT (!uc_is_general_category (0x00B2, ct));
- return 0;
+ return test_exit_status;
}
ASSERT (uc_is_general_category (0x00B2, ct));
}
- return 0;
+ return test_exit_status;
}
ASSERT (!uc_is_general_category (c, ct));
}
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (uc_general_category_long_name (UC_CATEGORY_Nl), "Letter Number") == 0);
ASSERT (uc_general_category_long_name (uc_general_category_or (UC_CATEGORY_Z, UC_CATEGORY_Nl)) == NULL);
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (uc_general_category_name (UC_CATEGORY_Nl), "Nl") == 0);
ASSERT (uc_general_category_name (uc_general_category_or (UC_CATEGORY_Z, UC_CATEGORY_Nl)) == NULL);
- return 0;
+ return test_exit_status;
}
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (uc_is_general_category (c, lowercase_letters));
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc_is_general_category ('7', ct));
ASSERT (!uc_is_general_category ('$', ct));
- return 0;
+ return test_exit_status;
}
ASSERT (!uc_is_general_category_withtable ('7', ctmask));
ASSERT (uc_is_general_category_withtable (0x00B2, ctmask));
- return 0;
+ return test_exit_status;
}
ASSERT (uc_combining_class (0x0327) == UC_CCC_ATB);
ASSERT (uc_combining_class (0x093C) == UC_CCC_NK);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_combining_class_byname ("Iota_Subscript") == UC_CCC_IS);
ASSERT (uc_combining_class_byname ("IotaSubscript") == UC_CCC_IS);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_combining_class_long_name (163) == NULL);
ASSERT (uc_combining_class_long_name (255) == NULL);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_combining_class_name (163) == NULL);
ASSERT (uc_combining_class_name (255) == NULL);
- return 0;
+ return test_exit_status;
}
for (; c < 0x110000; c++)
ASSERT (uc_decimal_value (c) == -1);
- return 0;
+ return test_exit_status;
}
for (; c < 0x110000; c++)
ASSERT (uc_digit_value (c) == -1);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_indic_conjunct_break_byname ("X") < 0);
ASSERT (uc_indic_conjunct_break_byname ("") < 0);
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (uc_indic_conjunct_break_name (UC_INDIC_CONJUNCT_BREAK_EXTEND), "Extend") == 0);
ASSERT (uc_indic_conjunct_break_name (-1) == NULL);
- return 0;
+ return test_exit_status;
}
for (; c < 0x110000; c++)
ASSERT (uc_indic_conjunct_break (c) == UC_INDIC_CONJUNCT_BREAK_NONE);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_joining_group_byname ("X") < 0);
ASSERT (uc_joining_group_byname ("") < 0);
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (uc_joining_group_name (UC_JOINING_GROUP_ZHAIN), "Zhain") == 0);
ASSERT (uc_joining_group_name (-1) == NULL);
- return 0;
+ return test_exit_status;
}
for (; c < 0x110000; c++)
ASSERT (uc_joining_group (c) == UC_JOINING_GROUP_NONE);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_joining_type_byname ("X") < 0);
ASSERT (uc_joining_type_byname ("") < 0);
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (uc_joining_type_long_name (UC_JOINING_TYPE_D), "Dual Joining") == 0);
ASSERT (uc_joining_type_long_name (-1) == NULL);
- return 0;
+ return test_exit_status;
}
ASSERT (strcmp (uc_joining_type_name (UC_JOINING_TYPE_D), "D") == 0);
ASSERT (uc_joining_type_name (-1) == NULL);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_joining_type (0x0613) == UC_JOINING_TYPE_T);
ASSERT (uc_joining_type (0x0614) == UC_JOINING_TYPE_T);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_mirror_char ('}', &mirrored) && mirrored == '{');
ASSERT (!uc_mirror_char ('X', &mirrored));
- return 0;
+ return test_exit_status;
}
ASSERT (value.numerator == 0 && value.denominator == 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (! uc_property_is_valid (pr));
}
- return 0;
+ return test_exit_status;
}
for (c = 0; c < 0x110000; c++)
ASSERT (uc_is_property (c, pr) == uc_is_property_composite (c));
- return 0;
+ return test_exit_status;
}
for (; c < 0x110000; c++)
ASSERT (!PREDICATE (c));
- return 0;
+ return test_exit_status;
}
ASSERT (found);
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc_c_ident_category (0x001B) == UC_IDENTIFIER_INVALID);
ASSERT (uc_c_ident_category (0xE0001) == UC_IDENTIFIER_INVALID);
- return 0;
+ return test_exit_status;
}
ASSERT (uc_java_ident_category (0x001B) == UC_IDENTIFIER_IGNORABLE);
ASSERT (uc_java_ident_category (0xE0001) == UC_IDENTIFIER_IGNORABLE);
- return 0;
+ return test_exit_status;
}
'.', 0xD83C, 0xDDE9, 0xD83C, 0xDDEA, 0xD83C, 0xDDEB, 0xD83C, 0xDDF7, '.',
-1);
- return 0;
+ return test_exit_status;
}
test_u16_grapheme_next (2, 0xd83d, 0xde10, -1); /* 😐: neutral face. */
test_u16_grapheme_next (3, 0xd83d, 0xde10, GRAVE, -1);
- return 0;
+ return test_exit_status;
}
test_u16_grapheme_prev (2, 0xd83d, 0xde10, -1); /* 😐: neutral face. */
test_u16_grapheme_prev (3, 0xd83d, 0xde10, GRAVE, -1);
- return 0;
+ return test_exit_status;
}
'.', 0x1F1E9, 0x1F1EA, 0x1F1EB, 0x1F1F7, '.',
-1);
- return 0;
+ return test_exit_status;
}
test_u32_grapheme_next (1, NEUTRAL_FACE, -1);
test_u32_grapheme_next (2, NEUTRAL_FACE, GRAVE, -1);
- return 0;
+ return test_exit_status;
}
test_u32_grapheme_prev (1, NEUTRAL_FACE, -1);
test_u32_grapheme_prev (2, NEUTRAL_FACE, GRAVE, -1);
- return 0;
+ return test_exit_status;
}
test_u8_grapheme_breaks (".\360\237\207\251\360\237\207\252\360\237\207\253\360\237\207\267.",
"##_______#_______#");
- return 0;
+ return test_exit_status;
}
test_u8_grapheme_next ("e"ACUTE"x", 4, 3);
test_u8_grapheme_next ("e"ACUTE "e"ACUTE, 6, 3);
- return 0;
+ return test_exit_status;
}
test_u8_grapheme_prev ("e"ACUTE"x", 4, 1);
test_u8_grapheme_prev ("e"ACUTE "e"ACUTE, 6, 3);
- return 0;
+ return test_exit_status;
}
}
ASSERT (uc == 0x110000);
- return 0;
+ return test_exit_status;
}
{
const char *filename;
char line[1024];
- int exit_code;
FILE *stream;
int lineno;
exit (1);
}
- exit_code = 0;
lineno = 0;
while (fgets (line, sizeof line, stream))
{
test_uc_grapheme_breaks (breaks, s, i, filename, lineno);
}
- return exit_code;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
test_function (u16_possible_linebreaks, 1);
#endif
- return 0;
+ return test_exit_status;
}
test_function (u16_width_linebreaks, 1);
#endif
- return 0;
+ return test_exit_status;
}
test_function (u32_possible_linebreaks, 1);
#endif
- return 0;
+ return test_exit_status;
}
test_function (u32_width_linebreaks, 1);
#endif
- return 0;
+ return test_exit_status;
}
test_function (u8_possible_linebreaks, 1);
#endif
- return 0;
+ return test_exit_status;
}
test_function (u8_width_linebreaks, 1);
#endif
- return 0;
+ return test_exit_status;
}
test_function (ulc_possible_linebreaks, 1);
#endif
- return 0;
+ return test_exit_status;
}
test_function (ulc_width_linebreaks, 1);
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (v >= (15 << 8));
ASSERT (v < (100 << 8));
- return 0;
+ return test_exit_status;
}
ASSERT (decomposed[0] == 0x1100);
ASSERT (decomposed[1] == 0x1173);
- return 0;
+ return test_exit_status;
}
ASSERT (decomposed[0] == 0x1100);
ASSERT (decomposed[1] == 0x1173);
- return 0;
+ return test_exit_status;
}
/* HANGUL SYLLABLE GEUL */
ASSERT (uc_composition (0xADF8, 0x11AF) == 0xAE00);
- return 0;
+ return test_exit_status;
}
ASSERT (uninorm_decomposing_form (UNINORM_NFKC) == UNINORM_NFKD);
ASSERT (uninorm_decomposing_form (UNINORM_NFKD) == UNINORM_NFKD);
- return 0;
+ return test_exit_status;
}
ASSERT (decomposed[0] == 0x1100);
ASSERT (decomposed[1] == 0x1173);
- return 0;
+ return test_exit_status;
}
#include "uninorm.h"
+#include "macros.h"
+
#if !(((defined _WIN32 || defined __CYGWIN__) && (HAVE_LIBUNISTRING || WOE32DLL)) || defined __ANDROID__)
/* Check that UNINORM_NFC is defined and links. */
uninorm_t n = UNINORM_NFC;
test_u16_nfc ();
test_u8_nfc ();
- return 0;
+ return test_exit_status;
}
#include "uninorm.h"
+#include "macros.h"
+
#if !(((defined _WIN32 || defined __CYGWIN__) && (HAVE_LIBUNISTRING || WOE32DLL)) || defined __ANDROID__)
/* Check that UNINORM_NFD is defined and links. */
uninorm_t n = UNINORM_NFD;
test_u16_nfd ();
test_u8_nfd ();
- return 0;
+ return test_exit_status;
}
#include "uninorm.h"
+#include "macros.h"
+
#if !(((defined _WIN32 || defined __CYGWIN__) && (HAVE_LIBUNISTRING || WOE32DLL)) || defined __ANDROID__)
/* Check that UNINORM_NFKC is defined and links. */
uninorm_t n = UNINORM_NFKC;
test_u16_nfkc ();
test_u8_nfkc ();
- return 0;
+ return test_exit_status;
}
#include "uninorm.h"
+#include "macros.h"
+
#if !(((defined _WIN32 || defined __CYGWIN__) && (HAVE_LIBUNISTRING || WOE32DLL)) || defined __ANDROID__)
/* Check that UNINORM_NFKD is defined and links. */
uninorm_t n = UNINORM_NFKD;
test_u16_nfkd ();
test_u8_nfkd ();
- return 0;
+ return test_exit_status;
}
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
test_ascii (u16_normcmp, UNINORM_NFD);
test_nonascii (u16_normcmp);
- return 0;
+ return test_exit_status;
}
on ASCII strings should behave like strcmp as well. */
test_ascii (u16_normcoll, UNINORM_NFC);
- return 0;
+ return test_exit_status;
}
#include "unistr.h"
#include "test-u32-normalize-big.h"
+#include "macros.h"
static int
check (const uint32_t *c1, size_t c1_length,
free_normalization_test_file (&file);
- return 0;
+ return test_exit_status;
}
#else
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include "unistr.h"
#include "test-u32-normalize-big.h"
+#include "macros.h"
static int
check (const uint32_t *c1, size_t c1_length,
free_normalization_test_file (&file);
- return 0;
+ return test_exit_status;
}
#else
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include "unistr.h"
#include "test-u32-normalize-big.h"
+#include "macros.h"
static int
check (const uint32_t *c1, size_t c1_length,
free_normalization_test_file (&file);
- return 0;
+ return test_exit_status;
}
#else
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include "unistr.h"
#include "test-u32-normalize-big.h"
+#include "macros.h"
static int
check (const uint32_t *c1, size_t c1_length,
free_normalization_test_file (&file);
- return 0;
+ return test_exit_status;
}
#else
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include "xalloc.h"
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
#define ASSERT_WITH_LINE(expr, file, line) \
test_ascii (u32_normcmp, UNINORM_NFD);
test_nonascii (u32_normcmp);
- return 0;
+ return test_exit_status;
}
on ASCII strings should behave like strcmp as well. */
test_ascii (u32_normcoll, UNINORM_NFC);
- return 0;
+ return test_exit_status;
}
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
#include <unistd.h>
#include "unistr.h"
+#define NO_MAIN_HERE
#include "macros.h"
static int
test_ascii (u8_normcmp, UNINORM_NFD);
test_nonascii (u8_normcmp);
- return 0;
+ return test_exit_status;
}
on ASCII strings should behave like strcmp as well. */
test_ascii (u8_normcoll, UNINORM_NFC);
- return 0;
+ return test_exit_status;
}
ASSERT (check (decomposed, SIZEOF (decomposed), input, SIZEOF (input)) == 0);
}
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_asnprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
return 1;
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
return 1;
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_vasprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vsnprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vsprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_asnprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
return 1;
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
return 1;
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_vasprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vsnprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vsprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_asnprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
return 1;
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
return 1;
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_vasprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vsnprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vsprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_asnprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
return 1;
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
return 1;
test_vasnprintf ();
- return 0;
+ return test_exit_status;
}
main (int argc, char *argv[])
{
test_vasprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vsnprintf ();
- return 0;
+ return test_exit_status;
}
{
test_vsprintf ();
- return 0;
+ return test_exit_status;
}
if (sizeof (UNIT) != sizeof (uint32_t))
free (input32);
- return 0;
+ return test_exit_status;
}
ASSERT (U_CMP2 (input2, 4, input1, 5) > 0);
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
#undef NMAX
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (u16_check (input, SIZEOF (input)) == input + 2);
}
- return 0;
+ return test_exit_status;
}
ASSERT (U_CMP (input2, input1, 1) < 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ret == -1);
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
{
test_function (u16_mbtouc_unsafe);
- return 0;
+ return test_exit_status;
}
{
test_function (u16_mbtouc);
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xFFFD);
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xFFFD);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check_invalid (input, SIZEOF (input)) == 0);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
{
test_strchr ();
- return 0;
+ return test_exit_status;
}
{
test_u16_strcmp ();
- return 0;
+ return test_exit_status;
}
test_u16_strcmp ();
- return 0;
+ return test_exit_status;
}
ASSERT (u16_strlen (input) == SIZEOF (input) - 1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ret == -1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xBADFACE);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
ASSERT (U_STRNCMP (input2, input1, 1000000) < 0);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
test_u_strstr ();
- return 0;
+ return test_exit_status;
}
{
test_u_strtok ();
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (u32_check (input, SIZEOF (input)) == input + 2);
}
- return 0;
+ return test_exit_status;
}
ASSERT (U_CMP (input2, input1, 1) < 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ret == -1);
}
- return 0;
+ return test_exit_status;
}
int
main ()
{
-
/* Simple string. */
{ /* "Grüß Gott. Здравствуйте! x=(-b±sqrt(b²-4ac))/(2a) 日本語,中文,한글" */
static const uint32_t input[] =
ASSERT (len == n);
}
}
- return 0;
+
+ return test_exit_status;
}
{
test_function (u32_mbtouc_unsafe);
- return 0;
+ return test_exit_status;
}
{
test_function (u32_mbtouc);
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xFFFD);
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xFFFD);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check_invalid (input, SIZEOF (input)) == 0);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
{
test_strchr ();
- return 0;
+ return test_exit_status;
}
{
test_u32_strcmp ();
- return 0;
+ return test_exit_status;
}
test_u32_strcmp ();
- return 0;
+ return test_exit_status;
}
ASSERT (u32_strlen (input) == SIZEOF (input) - 1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ret == -1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xBADFACE);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
ASSERT (U_STRNCMP (input2, input1, 1000000) < 0);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
test_u_strstr ();
- return 0;
+ return test_exit_status;
}
{
test_u_strtok ();
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
ASSERT (u8_check (input, sizeof (input) - 1) == input + 4);
}
- return 0;
+ return test_exit_status;
}
ASSERT (U_CMP (input2, input1, 4) < 0);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ret == -1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (u8_mbsnlen (input, 5) == 5);
}
- return 0;
+ return test_exit_status;
}
{
test_function (u8_mbtouc_unsafe);
- return 0;
+ return test_exit_status;
}
test_function (u8_mbtouc);
test_safe_function (u8_mbtouc);
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xFFFD);
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xFFFD);
}
- return 0;
+ return test_exit_status;
}
ASSERT (check_invalid (input, SIZEOF (input)) == 0);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
{
test_u8_strcmp ();
- return 0;
+ return test_exit_status;
}
test_u8_strcmp ();
- return 0;
+ return test_exit_status;
}
ASSERT (u8_strlen (input) == SIZEOF (input) - 1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (ret == -1);
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc == 0xBADFACE);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
ASSERT (U_STRNCMP (input2, input1, 1000000) < 0);
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
check (input, SIZEOF (input));
}
- return 0;
+ return test_exit_status;
}
test_u_strstr ();
- return 0;
+ return test_exit_status;
}
{
test_u_strtok ();
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
#endif
}
- return 0;
+ return test_exit_status;
}
}
}
- return 0;
+ return test_exit_status;
}
free (p);
}
- return 0;
+ return test_exit_status;
}
free (p);
}
- return 0;
+ return test_exit_status;
}
free (p);
}
- return 0;
+ return test_exit_status;
}
}
#endif
- return 0;
+ return test_exit_status;
}
ASSERT (u16_strwidth (input, "GB2312") == 6);
}
- return 0;
+ return test_exit_status;
}
ASSERT (u16_width (input + INPUT4_OFFSET, INPUT4_LENGTH, "GB2312") == 6);
}
- return 0;
+ return test_exit_status;
}
ASSERT (u32_strwidth (input, "GB2312") == 6);
}
- return 0;
+ return test_exit_status;
}
ASSERT (u32_width (input + INPUT4_OFFSET, INPUT4_LENGTH, "GB2312") == 6);
}
- return 0;
+ return test_exit_status;
}
ASSERT (u8_strwidth (input, "GB2312") == 6);
}
- return 0;
+ return test_exit_status;
}
ASSERT (u8_width (input + INPUT4_OFFSET, INPUT4_LENGTH, "GB2312") == 6);
}
- return 0;
+ return test_exit_status;
}
ASSERT (uc_width (0x20369, "UTF-8") == 2);
ASSERT (uc_width (0x2F876, "UTF-8") == 2);
- return 0;
+ return test_exit_status;
}
}
finish_interval ();
- return 0;
+ return test_exit_status;
}