+#include <array_length.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
const char input[] = "\x8e\xa1g\x8e\xa2h\x8e\xa3i\x8e\xa4j";
-int
-main (void)
+static int
+do_test (void)
{
wchar_t buf[1000];
-#define nbuf (sizeof (buf) / sizeof (buf[0]))
int result = 0;
ssize_t n;
}
#define CHECK(fmt, nexp, exp) \
- n = swprintf (buf, nbuf, fmt, input); \
+ n = swprintf (buf, array_length (buf), fmt, input); \
if (n != nexp) \
{ \
printf ("swprintf (.., .., L\"%ls\", \"%ls\") return %d, not %d\n", \
return result;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"