aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/tests/locale/wctomb_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/tests/locale/wctomb_test.c')
-rw-r--r--lib/libc/tests/locale/wctomb_test.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/libc/tests/locale/wctomb_test.c b/lib/libc/tests/locale/wctomb_test.c
index a1f19a44be4b..ef2a6dcbe1e3 100644
--- a/lib/libc/tests/locale/wctomb_test.c
+++ b/lib/libc/tests/locale/wctomb_test.c
@@ -32,7 +32,6 @@
* "ja_JP.eucJP". Other encodings are not tested.
*/
-#include <sys/cdefs.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>
@@ -42,6 +41,18 @@
#include <atf-c.h>
+ATF_TC_WITHOUT_HEAD(euccs1_test);
+ATF_TC_BODY(euccs1_test, tc)
+{
+ wchar_t wc = 0x8e000000;
+ char buf[MB_LEN_MAX];
+
+ ATF_REQUIRE(strcmp(setlocale(LC_CTYPE, "zh_CN.eucCN"),
+ "zh_CN.eucCN") == 0);
+
+ ATF_REQUIRE(wctomb(&buf[0], wc) == 4);
+}
+
ATF_TC_WITHOUT_HEAD(wctomb_test);
ATF_TC_BODY(wctomb_test, tc)
{
@@ -105,6 +116,7 @@ ATF_TC_BODY(wctomb_test, tc)
ATF_TP_ADD_TCS(tp)
{
+ ATF_TP_ADD_TC(tp, euccs1_test);
ATF_TP_ADD_TC(tp, wctomb_test);
return (atf_no_error());