]>
git.saurik.com Git - apple/libc.git/blob - tests/wchar.c
6 #include <darwintest.h>
9 * Test courtesy of Roel Standaert
10 * Source: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209907
12 T_DECL(PR_26556792
, "wcsrtombs neglects to set src pointer on EILSEQ error")
15 wchar_t *in
= L
"Hello! \x20AC Hello!";
16 const wchar_t *inptr
= in
;
17 mbstate_t state
= {{0}};
19 T_ASSERT_EQ((size_t)-1, wcsrtombs(out
, &inptr
, sizeof(out
), &state
), NULL
);
20 T_EXPECT_EQ((long)(inptr
- in
), (long)7, NULL
);
24 T_DECL(PR_26828480
, "double free in __vfwprintf")
29 test
= (wchar_t *) malloc(512 * sizeof(wchar_t));
30 ret
= swprintf(test
, 512, L
"%a, %s\n", 3.14, (char *) NULL
);
33 T_ASSERT_GT(ret
, 0, "swprintf");