summaryrefslogtreecommitdiff
path: root/Tests/LibC
AgeCommit message (Collapse)Author
2022-03-08LibC: Set `saved_str` to null in strtok_r if no tokens were foundDaniel Bertalan
If we do not do this, the next call to strtok_r will start tokenizing (and possibly modifying!) the memory pointed to by `saved_ptr`.
2022-03-08Tests: Include limits.h for PATH_MAX in realpath testsTim Schumacher
2022-03-08Tests: Include limits.h for MB_LEN_MAX in wchar testsTim Schumacher
2022-03-02AK: Print NaN and infinite numbers in PrintfImplementationPeter Ross
2022-03-02LibC: Set PRI[xX]8/PRI[xX]16 macros to `x` and `X`Peter Ross
Described in: <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ inttypes.h.html> The macros were first added in a7a456002e91d9f13793e23aab4c24519c4e87c7, but it is not clear why the PRIx16/32 macros were defined as 'b' & 'w'. PrintfImplementation was never able to parse these values.
2022-02-28AK: Add tests for integer values formatting in printfTimur Sultanov
2022-02-20LibC: Do not write value when scanf assignment value is suppressedPeter Ross
This change has the positive side-effect of causing scanf to *segfault* when a NULL pointer argument is passed to scanf. e.g. sscanf(str, "%d", NULL);
2022-02-20LibC: Do not include suppressed assignments in scanf return valuePeter Ross
2022-02-13Tests: Add test for LibC mkdir()Max Wipfli
2022-01-25LibC: Ensure most time tests run under UTCTimothy Flynn
This ensures these tests pass even if the user has changed the system time zone away from UTC.
2022-01-25LibC: Implement tzset with time zone awareness in accordance with POSIXTimothy Flynn
2022-01-16Tests: Test whether stdio streams are flushed correctly on exitDaniel Bertalan
2022-01-16LibC: Make `*alloc` return `NULL` in case of failure (POSIX)Michel Hermier
2022-01-07Everywhere: Fix spelling mistakesmjz19910
2022-01-02LibC: Support `X` modifier for `scanf`Jesse Buhagiar
This was currently crashing Half-Life because it was a considered an "Unknown" specifier. We can use the same case statement as the regular hex format conversion (lower case 'x'), as the backend to convert the number already supports upper/lower case input, hence we get it for free :^)
2021-12-23LibC: Allow multiple includes of `<assert.h>`Michel Hermier
ISO C requires in section 7.2: The assert macro is redefined according to the current state of NDEBUG each time that <assert.h> is included. Also add tests for `assert` multiple inclusion accordingly.
2021-12-19LibTest: Add `EXPECT_CRASH_WITH_SIGNAL`Michel Hermier
2021-12-19Tests: Add test for `raise`Michel Hermier
2021-12-19Tests: Add test for `assert`Michel Hermier
2021-12-19Tests: Add test for `abort`Michel Hermier
2021-10-24LibC: Fix `%n` conversion specifier in scanf() formatJelle Raaijmakers
Also add a test to prevent this from happening again. There were two bugs: * The number of bytes just after processing the last value was written, instead of the number of bytes after skipping remaining whitespace. Confirmed by testing against GNU's `scanf()` since the man page leaves something to be desired. * The number of bytes was written to the wrong variable argument; i.e. the first argument was overwritten.
2021-10-24Tests: Print full 32-byte range of values in TestScanfJelle Raaijmakers
We are trying to show 8 u32 values, each of which needs at most 8 hexadecimal characters to be shown entirely.
2021-10-24Tests: Reword 'output' to 'return value' in TestScanfJelle Raaijmakers
2021-10-24Tests: Use correct argument count for value conformance in TestScanfJelle Raaijmakers
2021-10-24Tests: Only test truthiness for iswctypeTim Schumacher
2021-10-24Tests: Use proper comparison macros for wctypeTim Schumacher
2021-10-22LibC: Fix up mblenTim Schumacher
2021-10-22LibC: Fix up mbtowcTim Schumacher
One more proper implementation and one less FIXME.
2021-10-21LibC: Implement mbsnrtowcsTim Schumacher
2021-10-21LibC: Implement wcsnrtombsTim Schumacher
2021-10-21LibC: Implement mbrlenTim Schumacher
2021-10-17LibC: Implement wcslcpyDaniel Bertalan
2021-10-15LibC: Implement mbsrtowcsTim Schumacher
2021-10-15LibC: Implement wcsrtombsTim Schumacher
2021-10-15LibC: Implement wcrtombDaniel Bertalan
This function converts a single wide character into its multibyte representation (UTF-8 in our case). It is called from libc++'s `std::basic_ostream<wchar_t>::flush`, which gets called at program exit from a global destructor in order to flush `std::wcout`.
2021-10-15LibC: Implement twalkTim Schumacher
2021-10-15LibC: Implement tfind and tsearchTim Schumacher
2021-10-04Everywhere: Fix more Copyright header inconsistenciesTim Schumacher
2021-10-03Tests: Add tests for mbrtowcTim Schumacher
2021-10-03Tests: Add a test for mbsinitTim Schumacher
2021-10-03LibC: Implement wmemmoveTim Schumacher
2021-10-03LibC: Implement wmemsetTim Schumacher
2021-10-03LibC: Implement wmemcpyTim Schumacher
2021-10-03LibC: Implement wmemchrTim Schumacher
2021-10-03LibC: Implement wcsstrTim Schumacher
2021-10-03LibC: Implement wcspbrkTim Schumacher
2021-09-18LibC: Primitively implement wcscollTim Schumacher
At the moment, sorting like LC_COLLATE=C would do is better than nothing.
2021-09-17LibC: Implement towctransTim Schumacher
2021-09-17LibC: Implement iswctypeTim Schumacher
2021-09-17LibC: Implement wctransTim Schumacher