Commit Graph
6 Commits
Author SHA1 Message Date
Dean f4fa6e4ca5 Merge pull request #12480 from Oscar45397/test/libc-fgetpos-fsetpos
test(libc): check fsetpos clears end of file and rejects a negative position
2026-11-03 02:38:03 +13:00
Oscar45397andClaude Opus 5.5 31b8c2ba6a test(libc): cover fseek to a negative offset, from the end and past the end
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 02:07:28 +01:00
bunbeans2-archandClaude Opus 5.5 6878d1be40 fix(tests): open scratch streams under a Unicode TEMP on Windows
On Windows, std::tmpfile() returns NULL with errno 22 when %TEMP%
contains a character outside the ANSI code page, where GetTempPathA
returns '?' in its place. Fifteen tests that capture output through it
aborted. TemporaryFile::Open() opens a unique delete-on-close file under
temp_directory_path() with _wfopen; other hosts keep std::tmpfile().

Part of #13083

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:21:00 +01:00
Oscar45397andClaude Opus 5.5 e43e1385fe test(libc): check fsetpos clears end of file and rejects a negative position
FilePosition checked fgetpos and fsetpos only on a freshly written
stream. It now reads three bytes and requires fgetpos to give 3, reads
to end of file and requires fsetpos back to 3 to clear the end-of-file
indicator (C11 7.21.9.3) so the next fgetc returns the fourth byte, and
requires fsetpos to -1 to fail with EINVAL as FreeBSD's fseeko does.

A rejected seek on Windows still moves the stream, because the UCRT
drops its read buffer before the failing lseek: recorded in libc's
technical debt instead of asserted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:04:45 +01:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
RomainROCH 99fbcf0377 fix(libc): propagate file position errors 2026-10-02 06:15:14 +02:00