.
[glibc/history.git] / misc / tst-error1.c
blobe84843ed2fbdd01f24e2f8a71075a4da5608dd2c
1 #include <error.h>
2 #include <mcheck.h>
3 #include <stdio.h>
4 #include <string.h>
5 #include <wchar.h>
7 static int
8 do_test (int argc, char *argv[])
10 mtrace ();
11 (void) freopen (argc == 1 ? "/dev/stdout" : argv[1], "a", stderr);
12 /* Orient the stream. */
13 fwprintf (stderr, L"hello world\n");
14 char buf[20000];
15 static const char str[] = "hello world! ";
16 for (int i = 0; i < 1000; ++i)
17 memcpy (&buf[i * (sizeof (str) - 1)], str, sizeof (str));
18 error (0, 0, str);
19 error (0, 0, buf);
20 error (0, 0, buf);
21 error (0, 0, str);
22 return 0;
25 #define TEST_FUNCTION do_test (argc, argv)
26 #include "../test-skeleton.c"