This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING][PATCH] [BZ #17596] mblen return code when n is zero
- From: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 07 Apr 2015 16:18:47 +0200
- Subject: Re: [PING][PATCH] [BZ #17596] mblen return code when n is zero
- Authentication-results: sourceware.org; auth=none
- References: <1415890908-50691-1-git-send-email-raji at linux dot vnet dot ibm dot com> <mvmk32z3y5l dot fsf at hawking dot suse dot de> <5464D746 dot 2030300 at cs dot ucla dot edu> <5465A7FC dot 4080701 at linux dot vnet dot ibm dot com> <20141127170625 dot GA13805 at domone> <20150306103646 dot GW12857 at vapier> <20150403134913 dot GA22649 at domone>
Hi,
the test localedata/tst_mbrlen fails with:
mbrlen:de_DE.ISO-8859-1:1:1:2:F:the return value is different from an
expected value
mbrlen:de_DE.ISO-8859-1:1:2:2:S:PASSED
mbrlen:de_DE.ISO-8859-1:1:3:2:S:PASSED
mbrlen:de_DE.ISO-8859-1:2:1:2:F:the return value is different from an
expected value
mbrlen:de_DE.ISO-8859-1:2:2:2:S:PASSED
mbrlen:de_DE.ISO-8859-1:2:3:2:S:PASSED
mbrlen:en_US.ANSI_X3.4-1968:1:1:2:F:the return value is different from
an expected value
mbrlen:en_US.ANSI_X3.4-1968:1:2:2:S:PASSED
mbrlen:en_US.ANSI_X3.4-1968:1:3:2:S:PASSED
mbrlen:en_US.ANSI_X3.4-1968:2:1:2:F:the return value is different from
an expected value
mbrlen:en_US.ANSI_X3.4-1968:2:2:1:S:PASSED
mbrlen:en_US.ANSI_X3.4-1968:2:2:2:S:PASSED
mbrlen:en_US.ANSI_X3.4-1968:2:3:1:S:PASSED
mbrlen:en_US.ANSI_X3.4-1968:2:3:2:S:PASSED
mbrlen:ja_JP.EUC-JP:1:1:2:S:PASSED
mbrlen:ja_JP.EUC-JP:1:2:2:S:PASSED
mbrlen:ja_JP.EUC-JP:1:3:2:S:PASSED
mbrlen:ja_JP.EUC-JP:2:1:2:S:PASSED
mbrlen:ja_JP.EUC-JP:2:2:2:S:PASSED
mbrlen:ja_JP.EUC-JP:2:3:2:S:PASSED
mbrlen:ja_JP.EUC-JP:3:1:2:F:the return value is different from an
expected value
mbrlen:ja_JP.EUC-JP:3:2:2:S:PASSED
mbrlen:ja_JP.EUC-JP:3:3:1:S:PASSED
mbrlen:ja_JP.EUC-JP:3:3:2:S:PASSED
and test localedata/tst_mbrtowc fails with:
mbrtowc:de_DE.ISO-8859-1:1:1:3:F:Initialization failed - skipping this
test case.
mbrtowc:de_DE.ISO-8859-1:2:1:3:F:Initialization failed - skipping this
test case.
This patch change the expected results for mbrlen in case of passing n=0
to -2. The initialization of tst_mbrtowc is changed in the same way.
Tested on s390/s390x.
Please commit.
Bye Stefan
---
2015-04-07 Stefan Liebler <stli@linux.vnet.ibm.com>
localedata/tests-mbwc/dat_mbrlen.c
(tst_mbrlen_loc): Change expected result to -2
in case of n == 0.
localedata/tests-mbwc/tst_mbrtowc.c (tst_mbrtowc):
Check result against -2 instead of 0.
On 04/03/2015 03:49 PM, OndÅej BÃlka wrote:
On Fri, Mar 06, 2015 at 05:36:46AM -0500, Mike Frysinger wrote:
On 27 Nov 2014 18:06, OndÅej BÃlka wrote:
Andreas, do you have more comments or could you commit it as it looks as
correct fix?
lets push it
-mike
Done.
diff --git a/localedata/tests-mbwc/dat_mbrlen.c b/localedata/tests-mbwc/dat_mbrlen.c
index 61e8423..1df485e 100644
--- a/localedata/tests-mbwc/dat_mbrlen.c
+++ b/localedata/tests-mbwc/dat_mbrlen.c
@@ -30,7 +30,7 @@ TST_MBRLEN tst_mbrlen_loc [] = {
},
{
{
- { 0, 1, 0, },
+ { 0, 1, -2, },
{ 0, 1, 0, },
{ 0, 1, 1, },
}
@@ -46,7 +46,7 @@ TST_MBRLEN tst_mbrlen_loc [] = {
},
{
{
- { 0, 1, 0, },
+ { 0, 1, -2, },
{ 0, 1, 1, },
{ 0, 1, 1, },
}
@@ -68,7 +68,7 @@ TST_MBRLEN tst_mbrlen_loc [] = {
},
{
{
- { 0, 1, 0, },
+ { 0, 1, -2, },
{ 0, 1, 1, },
{ 0, 1, 1, },
}
@@ -84,7 +84,7 @@ TST_MBRLEN tst_mbrlen_loc [] = {
},
{
{
- { 0, 1, 0, },
+ { 0, 1, -2, },
{ EILSEQ, 1, -1, },
{ EILSEQ, 1, -1, },
}
@@ -140,7 +140,7 @@ TST_MBRLEN tst_mbrlen_loc [] = {
},
{
{
- { 0, 1, 0, },
+ { 0, 1, -2, },
{ 0, 1, -2, },
{ EILSEQ, 1, -1, },
}
diff --git a/localedata/tests-mbwc/tst_mbrtowc.c b/localedata/tests-mbwc/tst_mbrtowc.c
index ffb33ce..20507ab 100644
--- a/localedata/tests-mbwc/tst_mbrtowc.c
+++ b/localedata/tests-mbwc/tst_mbrtowc.c
@@ -26,7 +26,7 @@ tst_mbrtowc (FILE * fp, int debug_flg)
TST_HEAD_LOCALE (mbrtowc, S_MBRTOWC);
TST_DO_REC (mbrtowc)
{
- if (mbrtowc (NULL, "", 0, &t) != 0)
+ if (mbrtowc (NULL, "", 0, &t) != -2)
{
err_count++;
Result (C_FAILURE, S_MBRTOWC, CASE_3,