summaryrefslogtreecommitdiff
path: root/libc/test/src/stdlib/strtol_test.cpp
AgeCommit message (Collapse)Author
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-06-01[libc] Add strtoint32 and strtoint64 testsMichael Jones
There were regressions in the testing framework due to none of the functioning buildbots having a 32 bit long. This allowed the 32 bit version of the strtointeger function to go untested. This patch adds tests for strtoint32 and strtoint64, which are internal testing functions that use constant integer sizes. It also fixes the tests to properly handle these situations. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D151935
2023-02-07[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.Siva Chandra Reddy
This part of the effort to make all test related pieces into the `test` directory. This helps is excluding test related pieces in a straight forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move the MPFR wrapper and testutils into the 'test' directory.
2022-12-22[libc] change str to int tests to be templatedMichael Jones
Previously the tests were copy/pasted into several files, this changes them to be instead templated and sharing one file. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D140441
2021-10-25[libc] fix strtol returning the wrong lengthMichael Jones
Previously, strtol/ll/ul/ull would return a pointer to the end of its parsing, regardless of if it detected a number. Now it will return a length of 0 when it doesn't find a number. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D112176
2021-09-03[libc] fix strtointeger hex prefix parsingMichael Jones
Fix edge case where "0x" would be considered a complete hexadecimal number for purposes of str_end. Now the hexadecimal prefix needs a valid digit after it, else just the 0 will be counted as the number. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D109084
2021-08-27[libc] Fix various -Wconversion warnings in strto*l test code.Roland McGrath
The Fuchsia build compiles the libc and test code with lots of warnings enabled, including all the integer conversion warnings. There was some sloppy type usage here that triggered some of those. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D108800
2021-08-24[libc] Fix type errors on WindowsMichael Jones
Fix the errors caused by having some numbers too large for a 32 bit number in the tests for windows. Also fix the base causing some type confusion. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D108653
2021-08-24[libc] fix string conversion tests for windowsMichael Jones
There were some copy paste errors as well as some oddities around how windows handles the difference between long and long long types. This change fixes those. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D108591
2021-08-17[libc] Add strtol, strtoul, and strtoullMichael Jones
Updates the internal string conversion function so that it uses the new Limits.h added in a previous commit for max and min values, and has a templated type. This makes implementing the other strto* functions very simple. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D107999