Repository navigation
Conversation
9 tasks done
Contributor
|
Tested on Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, Intel Core i7-12700H (20 logical CPUs). I merged it onto
Tested with AI assistance (Claude Code). |
9 tasks done
6 tasks done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ULF8vCbJFyzxVsW3SfiWC5
cubersu
force-pushed
the
test/libc-strlcpy-strcasecmp
branch
from
October 8, 2026 14:04
791dbec to
9800598
Compare
This was referenced Oct 8, 2026
9 tasks done
9 tasks done
Collaborator
|
Closing: the tests pass on main and no fix or title comes with them. If a title shows |
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds behavioural tests for three libc exports that had no coverage:
strlcpy,strcasecmpandstrncasecmp(Strings.cpp). Test-only change, no implementation changes.strlcpy: return value is the source length in every case; truncation keepssize - 1bytes plus the terminator; exact fit and one-byte overflow;size1 writes only the terminator;size0 leaves the destination untouched; no padding past the terminator.strcasecmp/strncasecmp: equality across case, sign of the result for ordered and prefix strings, comparison after lowering ("A"vs"["), unsigned comparison of bytes above 0x7f,nof 0, stopping atn, andnlarger than both strings.Expected values follow FreeBSD
strlcpy(3)and POSIXstrcasecmpin the C locale. Only the sign of comparison results is checked.strncpy_sis left out on purpose: #1336 already adds tests for it in the same file.Tested
Linux (Ubuntu 24.04, GCC 13.3),
ctest -R guest_strings. Each new check was also confirmed to fail against a deliberately broken implementation (off-by-one instrlcpy, invertedstrcasecmpsign, comparison withouttolower,strncasecmpignoringn). Windows not tested.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01ULF8vCbJFyzxVsW3SfiWC5