NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/60369 CVS commit: [netbsd-11] src/tests/lib/libc/locale



The following reply was made to PR standards/60369; it has been noted by GNATS.

From: "Martin Husemann" <martin%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/60369 CVS commit: [netbsd-11] src/tests/lib/libc/locale
Date: Fri, 3 Jul 2026 17:49:19 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Jul  3 17:49:19 UTC 2026
 
 Modified Files:
 	src/tests/lib/libc/locale [netbsd-11]: t_mbrtowc.c t_mbstowcs.c
 
 Log Message:
 Additonally pull up following revision(s) (requested by wiz in ticket #339):
 
 	tests/lib/libc/locale/t_mbstowcs.c: revision 1.4
 	tests/lib/libc/locale/t_mbstowcs.c: revision 1.5
 	tests/lib/libc/locale/t_mbrtowc.c: revision 1.3
 	tests/lib/libc/locale/t_mbrtowc.c: revision 1.4
 	tests/lib/libc/locale/t_mbrtowc.c: revision 1.5
 
 t_mbrtowc: Mark UTF-8 test cases xfail.
 
 mbrtowc previously failed to reject invalid (legacy 5/6-byte) UTF-8,
 so it accepted this test case.  Now it rejects this test case,
 because the test case itself is broken.
 
 Need to split this test up into:
 1. correctly decoding the valid inputs
 2. correctly rejecting the invalid inputs
 
 But for now marking the test case xfail is an adequate approximation
 to the more complicated truth.
 PR lib/60369: mbrtowc, mbrlen have wrong return value for some
 invalid byte sequences: Invalid sequence
 
 t_mbstowcs: Mark UTF-8 test cases xfail.
 mbrtowc fails to reject invalid (legacy 5/6-byte) UTF-8.
 
 Need to split this test up into:
 1. correctly decoding the valid inputs
 2. correctly rejecting the invalid inputs
 
 Also don't stop at the first failing test in t_mbrtowc; keep going to
 test everything, for better diagnostics at the end in the test
 report.
 
 As with t_mbrtowc, this should be split into multiple parts, TBD.
 
 PR lib/60369: mbrtowc, mbrlen have wrong return value for some
 invalid byte sequences: Invalid sequence
 
 PR lib/60369 Update tests to match modern UTF-8
 
 This just removes test cases using invalid (by current standards) UTF-8
 sequences (in one case the test is modified to switch it from invalid to valid)
 
 The XFAIL that was added is removed.    ("removed" in all of this means
 hashifd away).
 
 There is, in this change, no attempt to fix either of the other very valid
 concerns - actually testing invalid input to ensure it is rejected (would
 need to be a whole new test case, the way they are currently structured is
 not condusive to that - the input is simply known to be valid),  nor having
 the test continue to try the remaining cases if an invalid result is obtained
 rather than simply abandoning ship at the first opportunity.
 
 Also note that none of this really has anything whatever to do with the
 PR, which had nothing at all to do with what is valid UTF-8 and what is
 not, but merely when something that is to be treated as invalid is
 detetected, that MUST be reported, the (libc, not test) code must not
 go on to examine further bytes and end up reporting that more are needed
 (even if more would be needed were the input valid).   That is, when both
 conditions exist, the error is reported, not the insufficient data.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.2.20.1 src/tests/lib/libc/locale/t_mbrtowc.c
 cvs rdiff -u -r1.3 -r1.3.4.1 src/tests/lib/libc/locale/t_mbstowcs.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 



Home | Main Index | Thread Index | Old Index