public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-03-29 20:35 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-03-29 20:35 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=34a9d613800cdb2287970e46faf6c62eb4ab5959
commit 34a9d613800cdb2287970e46faf6c62eb4ab5959
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2024-04-17 20:11 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:11 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=edae9c07c2b3449103a76ae77cc12732f604c248
commit edae9c07c2b3449103a76ae77cc12732f604c248
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2024-04-02 15:57 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:57 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cd59efef1a813e73bc7982cea09fd70a8e4387ed
commit cd59efef1a813e73bc7982cea09fd70a8e4387ed
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2024-02-09 17:36 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:36 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4dce9a1277724945fec26fce3fc8b0d837951762
commit 4dce9a1277724945fec26fce3fc8b0d837951762
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2024-02-07 14:11 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:11 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cd01b896d817782ccd17a1b49c93aa32a4d426f7
commit cd01b896d817782ccd17a1b49c93aa32a4d426f7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2024-01-29 18:01 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 18:01 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5f4c29cb819d7354753317d8125ac3e5450f0649
commit 5f4c29cb819d7354753317d8125ac3e5450f0649
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2023-12-21 18:58 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:58 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b1caf92e435e116ca06f04f0514a4c1bf15186f1
commit b1caf92e435e116ca06f04f0514a4c1bf15186f1
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2023-09-28 17:56 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:56 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=116c116f6943bd9d38774099288f65ed170889f4
commit 116c116f6943bd9d38774099288f65ed170889f4
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2023-08-30 12:40 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:40 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=073e4e86fb2ec971c6f1a0afebeb27be97eb1109
commit 073e4e86fb2ec971c6f1a0afebeb27be97eb1109
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2023-02-09 19:52 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:52 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1b96c75d7ba2b764aa556cf747cb60b5dda60c62
commit 1b96c75d7ba2b764aa556cf747cb60b5dda60c62
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-10-28 17:45 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:45 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7cf6733ee0e19b45f3dbba59a7b5893a36f7603f
commit 7cf6733ee0e19b45f3dbba59a7b5893a36f7603f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-10-04 13:03 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 13:03 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b43eed8ce71de70edc56a5b6e0eb96f30ea74552
commit b43eed8ce71de70edc56a5b6e0eb96f30ea74552
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-06-09 21:24 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:24 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=076e038b61b101d8cfc913bf1b40d220f7c18ce5
commit 076e038b61b101d8cfc913bf1b40d220f7c18ce5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-06-09 13:20 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:20 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=076e038b61b101d8cfc913bf1b40d220f7c18ce5
commit 076e038b61b101d8cfc913bf1b40d220f7c18ce5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-06-03 14:10 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:10 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bc02f45c20d38f7b7a091208fd0a34682e4d340a
commit bc02f45c20d38f7b7a091208fd0a34682e4d340a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-05-13 14:24 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:24 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d5757422941384af5fa44c76c71274bbb5577328
commit d5757422941384af5fa44c76c71274bbb5577328
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-05-12 19:37 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:37 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b6c7ed6a75e39b6fec16ccb672f6ecd602322eca
commit b6c7ed6a75e39b6fec16ccb672f6ecd602322eca
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-05-10 18:28 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:28 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dfe63b207027b569bcb9b3f8e448f338f176dad9
commit dfe63b207027b569bcb9b3f8e448f338f176dad9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-04-29 14:08 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:08 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=058bb0d51c3f85041c7cbd14704f72003bdbdee9
commit 058bb0d51c3f85041c7cbd14704f72003bdbdee9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-04-04 12:58 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-04-04 12:58 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f73c43d3ede1cb4859825542427e99bd2bd07cfe
commit f73c43d3ede1cb4859825542427e99bd2bd07cfe
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
* [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests
@ 2022-03-31 19:10 Adhemerval Zanella
0 siblings, 0 replies; 21+ messages in thread
From: Adhemerval Zanella @ 2022-03-31 19:10 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0e4cf14b4756a6d647ca805835ab2ab30f62ac31
commit 0e4cf14b4756a6d647ca805835ab2ab30f62ac31
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Mar 28 15:50:07 2022 -0300
localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.
Diff:
---
localedata/bug-iconv-trans.c | 2 +-
localedata/tests-mbwc/dat_mbrtowc.c | 12 ++++++------
localedata/tests-mbwc/dat_mbsrtowcs.c | 12 ++++++------
localedata/tests-mbwc/dat_strcoll.c | 13 ++++++++-----
localedata/tests-mbwc/dat_swscanf.c | 2 +-
localedata/tests-mbwc/dat_wcrtomb.c | 4 ++--
localedata/tests-mbwc/dat_wcsrtombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wcstombs.c | 10 +++++-----
localedata/tests-mbwc/dat_wctomb.c | 4 ++--
localedata/tst-xlocale1.c | 4 ++--
localedata/tst-xlocale2.c | 2 +-
11 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/localedata/bug-iconv-trans.c b/localedata/bug-iconv-trans.c
index f1a0416547..c4c0ab74f1 100644
--- a/localedata/bug-iconv-trans.c
+++ b/localedata/bug-iconv-trans.c
@@ -7,7 +7,7 @@ int
main (void)
{
iconv_t cd;
- const char str[] = "ÄäÖöÜüß";
+ const char str[] = "\xc4\xe4\xd6\xf6\xdc\xfc\xdf";
const char expected[] = "AEaeOEoeUEuess";
char *inptr = (char *) str;
size_t inlen = strlen (str) + 1;
diff --git a/localedata/tests-mbwc/dat_mbrtowc.c b/localedata/tests-mbwc/dat_mbrtowc.c
index b8eb3dd210..0387045bd1 100644
--- a/localedata/tests-mbwc/dat_mbrtowc.c
+++ b/localedata/tests-mbwc/dat_mbrtowc.c
@@ -23,9 +23,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
@@ -39,9 +39,9 @@ TST_MBRTOWC tst_mbrtowc_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, 1, "ÄÖÜ", 1, 0, 0 },
- { 1, 1, "ÄÖÜ", 2, 0, 0 },
- { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 1, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", 2, 0, 0 },
+ { 1, 1, "\xc4\xd6\xdc", USE_MBCURMAX, 0, 0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_mbsrtowcs.c b/localedata/tests-mbwc/dat_mbsrtowcs.c
index e1ee1819a8..3604accc05 100644
--- a/localedata/tests-mbwc/dat_mbsrtowcs.c
+++ b/localedata/tests-mbwc/dat_mbsrtowcs.c
@@ -15,9 +15,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #01 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "üäö", 3, 0,0 },
- { 1, "üäö", 2, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 3, 0,0 },
+ { 1, "\xfc\xe4\xf6", 2, 0,0 },
}
},
{
@@ -31,9 +31,9 @@ TST_MBSRTOWCS tst_mbsrtowcs_loc [] = {
{ /*----------------- #02 -----------------*/
{
{
- { 1, "üäö", 4, 0,0 },
- { 1, "", 1, 0,0 },
- { 0, "üäö", 4, 0,0 },
+ { 1, "\xfc\xe4\xf6", 4, 0,0 },
+ { 1, "", 1, 0,0 },
+ { 0, "\xfc\xe4\xf6", 4, 0,0 },
}
},
{
diff --git a/localedata/tests-mbwc/dat_strcoll.c b/localedata/tests-mbwc/dat_strcoll.c
index b729ae9e89..fd14090eed 100644
--- a/localedata/tests-mbwc/dat_strcoll.c
+++ b/localedata/tests-mbwc/dat_strcoll.c
@@ -27,13 +27,16 @@ TST_STRCOLL tst_strcoll_loc [] = {
{
{ Tstrcoll, TST_LOC_de },
{
- { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
+ { /*input.*/ { "\xc4\x42\x43\x44\x45\x46\x47",
+ "\xc4\x42\x43\x44\x45\x46\x47" }, /* #1 */
/*expect*/ { 0,1,0, },
},
- { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
+ { /*input.*/ { "\x58\x58\x20\xc4\x20\x58\x58",
+ "XX B XX" }, /* #2 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
+ { /*input.*/ { "XX B XX",
+ "\x58\x58\x20\xc4\x20\x58\x58" }, /* #3 */
/*expect*/ { 0,0,+1, },
},
{ /*input.*/ { "B", "a" }, /* #4 */
@@ -48,10 +51,10 @@ TST_STRCOLL tst_strcoll_loc [] = {
{ /*input.*/ { "A", "b" }, /* #7 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "ä", "B" }, /* #8 */
+ { /*input.*/ { "\xe4", "B" }, /* #8 */
/*expect*/ { 0,0,-1, },
},
- { /*input.*/ { "B", "ä" }, /* #9 */
+ { /*input.*/ { "B", "\xe4" }, /* #9 */
/*expect*/ { 0,0,+1, },
},
{ .is_last = 1 } /* Last element. */
diff --git a/localedata/tests-mbwc/dat_swscanf.c b/localedata/tests-mbwc/dat_swscanf.c
index 7f6583222a..eb813f2267 100644
--- a/localedata/tests-mbwc/dat_swscanf.c
+++ b/localedata/tests-mbwc/dat_swscanf.c
@@ -31,7 +31,7 @@ TST_SWSCANF tst_swscanf_loc [] =
{ /* The fields are: err_val, ret_flag, ret_val,
val_int, val_uns, val_flt, val_c, val_s, val_S. */
0,1,5,
- -1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
+ -1, 2, 3.3, '\xe4', "\xc4\xdc", { 0x0000, },
},
},
/*------------------------ 02 -----------------------*/
diff --git a/localedata/tests-mbwc/dat_wcrtomb.c b/localedata/tests-mbwc/dat_wcrtomb.c
index 8500f68443..826e373ea6 100644
--- a/localedata/tests-mbwc/dat_wcrtomb.c
+++ b/localedata/tests-mbwc/dat_wcrtomb.c
@@ -13,11 +13,11 @@ TST_WCRTOMB tst_wcrtomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00FC, 0,0 },
- /*expect*/ { 0, 1,1, "ü" },
+ /*expect*/ { 0, 1,1, "\xfc" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00D6, 0,0 },
- /*expect*/ { 0, 1,1, "Ö" },
+ /*expect*/ { 0, 1,1, "\xd6" },
},
/* #03 : error case */
{ /*input.*/ { 1, 0xFFA1, 0,0 },
diff --git a/localedata/tests-mbwc/dat_wcsrtombs.c b/localedata/tests-mbwc/dat_wcsrtombs.c
index d3148b2a55..e98a533485 100644
--- a/localedata/tests-mbwc/dat_wcsrtombs.c
+++ b/localedata/tests-mbwc/dat_wcsrtombs.c
@@ -26,26 +26,26 @@ TST_WCSRTOMBS tst_wcsrtombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1, 0, 0 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2, 0, 0 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5, 0, 0 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2, 0, 0 },
diff --git a/localedata/tests-mbwc/dat_wcstombs.c b/localedata/tests-mbwc/dat_wcstombs.c
index a6dd0ec662..ad9f44fec3 100644
--- a/localedata/tests-mbwc/dat_wcstombs.c
+++ b/localedata/tests-mbwc/dat_wcstombs.c
@@ -25,26 +25,26 @@ TST_WCSTOMBS tst_wcstombs_loc [] = {
},
/* #02 : Only one chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 1 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #03 : Only two chars should be stored in s. No null termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 2 },
- /*expect*/ { 0,1,2, "ÄÖ" },
+ /*expect*/ { 0,1,2, "\xc4\xd6" },
},
/* #04 : Only three chars should be stored in s. No null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 3 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #05 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 4 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #06 : Only three chars should be stored in s with a null
termination. */
{ /*input.*/ { 1,1, { 0x00C4,0x00D6,0x00DC,0x0000 }, 5 },
- /*expect*/ { 0,1,3, "ÄÖÜ" },
+ /*expect*/ { 0,1,3, "\xc4\xd6\xdc" },
},
/* #07 : Invalid mb sequence. No chars should be stored in s. */
{ /*input.*/ { 1,1, { 0x0201,0x0221,0x0000,0x0000 }, 2 },
diff --git a/localedata/tests-mbwc/dat_wctomb.c b/localedata/tests-mbwc/dat_wctomb.c
index 7394ca530b..1b8227e6e9 100644
--- a/localedata/tests-mbwc/dat_wctomb.c
+++ b/localedata/tests-mbwc/dat_wctomb.c
@@ -59,11 +59,11 @@ TST_WCTOMB tst_wctomb_loc [] = {
{
/* #01 : normal case */
{ /*input.*/ { 1, 0x00C4 },
- /*expect*/ { 0,1,1, "Ä" },
+ /*expect*/ { 0,1,1, "\xc4" },
},
/* #02 : normal case */
{ /*input.*/ { 1, 0x00DC },
- /*expect*/ { 0,1,1, "Ü" },
+ /*expect*/ { 0,1,1, "\xdc" },
},
/* #03 : normal case */
{ /*input.*/ { 1, 0x0092 },
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
index 9f545a02c3..e6c5970759 100644
--- a/localedata/tst-xlocale1.c
+++ b/localedata/tst-xlocale1.c
@@ -13,9 +13,9 @@ static struct
{
{ "C", "TRANSLIT", "translit", 0 },
{ "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
+ { "de_DE.ISO-8859-1", "TRANSLIT", "tr\xc4nslit", -1 },
{ "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
- { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
+ { "de_DE.ISO-8859-1", "\xe4", "\xc4", 1 }
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
diff --git a/localedata/tst-xlocale2.c b/localedata/tst-xlocale2.c
index 7f99050168..3387d7f485 100644
--- a/localedata/tst-xlocale2.c
+++ b/localedata/tst-xlocale2.c
@@ -36,7 +36,7 @@ main (void)
}
-static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
+static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyz\xe4\xc4\xf6\xd6\xfc\xdc";
static const char exd[] = "11111111110000000000000000000000000000000000000000";
static const char exa[] = "00000000001111110111111011111111111111111111111111";
static const char exx[] = "11111111111111110111111000000000000000000000000000";
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2024-04-17 20:11 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 20:35 [glibc/azanella/clang] localedata: Use hexadecimal character escape on tests Adhemerval Zanella
2022-03-31 19:10 Adhemerval Zanella
2022-04-04 12:58 Adhemerval Zanella
2022-04-29 14:08 Adhemerval Zanella
2022-05-10 18:28 Adhemerval Zanella
2022-05-12 19:37 Adhemerval Zanella
2022-05-13 14:24 Adhemerval Zanella
2022-06-03 14:10 Adhemerval Zanella
2022-06-09 13:20 Adhemerval Zanella
2022-06-09 21:24 Adhemerval Zanella
2022-10-04 13:03 Adhemerval Zanella
2022-10-28 17:45 Adhemerval Zanella
2023-02-09 19:52 Adhemerval Zanella
2023-08-30 12:40 Adhemerval Zanella
2023-09-28 17:56 Adhemerval Zanella
2023-12-21 18:58 Adhemerval Zanella
2024-01-29 18:01 Adhemerval Zanella
2024-02-07 14:11 Adhemerval Zanella
2024-02-09 17:36 Adhemerval Zanella
2024-04-02 15:57 Adhemerval Zanella
2024-04-17 20:11 Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).