summaryrefslogtreecommitdiffstats
path: root/tests/bit.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix includesTavian Barnes2024-08-291-1/+0
|
* build: Move feature test macros to prelude.hTavian Barnes2024-08-281-2/+1
| | | | | | This replaces the explicit CPPFLAGS list in flags.mk with just `-include src/prelude.h`, shortening our compiler command lines and allowing them to be easily documented.
* prelude: Split bfs-specific utilities into new bfs.h headerTavian Barnes2024-08-281-1/+4
|
* diag: Get rid of bfs_static_assert()Tavian Barnes2024-08-281-31/+37
| | | | | In most cases, it's not too annoying to specify a message. For tests/bit.c, we can manually polyfill the 1-argument version.
* tests: Simplify unit tests with a global variableTavian Barnes2024-07-071-58/+54
| | | | | It's a little awkward to thread the test result through manually; much easier to just make bfs_check() update a global variable.
* bit: Update to match C23Tavian Barnes2024-05-291-18/+18
| | | | | | | | | | Based on the latest C23 draft (N3220): - Argument types to generic bit functions should be unsigned - Bit functions return unsigned int - Byte-swapping functions (stdc_memreverse8*()) weren't added - stdc_rotate_{left,right}() weren't added - first_leading_*() counts from the *left*
* Rename config.h to prelude.hTavian Barnes2024-04-191-1/+1
|
* tests: Add ../src to the include pathTavian Barnes2024-04-191-3/+3
|
* bit: Check __BYTE_ORDER__ for the native endianTavian Barnes2024-03-211-0/+13
| | | | __ORDER_NATIVE_ENDIAN__ is not a thing.
* Re-run include-what-you-useTavian Barnes2024-03-111-1/+1
|
* tests: New bfs_check() macroTavian Barnes2024-02-291-53/+55
| | | | | We now report failures and continue, rather than aborting after the first failure.
* tests: Merge unit test executables into oneTavian Barnes2024-01-121-2/+3
|
* Revert "bit: Implement a branchless has_single_bit()"Tavian Barnes2023-11-111-0/+1
| | | | | | Doesn't work for the highest bit due to overflow. This reverts commit 208376ef99da243545efcd6fb02d3469b4c068ed.
* bit: Implement a branchless has_single_bit()Tavian Barnes2023-11-101-0/+3
|
* Switch from assert() to bfs_assert()/bfs_verify()Tavian Barnes2023-05-181-50/+50
|
* bit: Rename int.h to bit.hTavian Barnes2023-05-181-0/+121