8 static const char test_locale
[] = "de_DE.UTF-8";
13 size_t l1
= strxfrm (NULL
, "ab", 0);
14 size_t l2
= strxfrm (buf
, "ab", 1);
15 size_t l3
= strxfrm (buf
, "ab", sizeof (buf
));
16 if (l3
< sizeof (buf
) && strlen (buf
) != l3
)
18 puts ("C locale l3 test failed");
22 size_t l4
= strxfrm (buf
, "ab", l1
+ 1);
23 if (l4
< l1
+ 1 && strlen (buf
) != l4
)
25 puts ("C locale l4 test failed");
30 size_t l5
= strxfrm (buf
, "ab", l1
);
33 puts ("C locale l5 test failed");
37 if (l1
!= l2
|| l1
!= l3
|| l1
!= l4
|| l1
!= l5
)
39 puts ("C locale retval test failed");
43 if (setlocale (LC_ALL
, test_locale
) == NULL
)
45 printf ("cannot set locale \"%s\"\n", test_locale
);
50 l1
= strxfrm (NULL
, "ab", 0);
51 l2
= strxfrm (buf
, "ab", 1);
52 l3
= strxfrm (buf
, "ab", sizeof (buf
));
53 if (l3
< sizeof (buf
) && strlen (buf
) != l3
)
55 puts ("UTF-8 locale l3 test failed");
59 l4
= strxfrm (buf
, "ab", l1
+ 1);
60 if (l4
< l1
+ 1 && strlen (buf
) != l4
)
62 puts ("UTF-8 locale l4 test failed");
67 l5
= strxfrm (buf
, "ab", l1
);
70 puts ("UTF-8 locale l5 test failed");
74 if (l1
!= l2
|| l1
!= l3
|| l1
!= l4
|| l1
!= l5
)
76 puts ("UTF-8 locale retval test failed");
84 #include <support/test-driver.c>