]> Kevux Git Server - fll/commit
Update: Add f_conversion unit tests.
authorKevin Day <thekevinday@gmail.com>
Wed, 26 Jan 2022 03:26:26 +0000 (21:26 -0600)
committerKevin Day <thekevinday@gmail.com>
Wed, 26 Jan 2022 03:46:24 +0000 (21:46 -0600)
commit8fb9840c832c897563b7b8e2317d7c764a3d0791
treef587ad8a2f717c973d994156281186ec82e0ee2f
parentbf63292e1f8b064ac6722f4ac2435398e24dbde1
Update: Add f_conversion unit tests.

There are far more permutations than what are handled within this commit.
Focus on only the most basic set of checks to write the unit tests for.

There are problems with mocking fwrite_unlocked() via the wrap strategy used by the linker.
I do not know why this is not working so I commented out the code and moved on.

Several problems are exposed and are solved.
- This exposed the fwrite_unlocked() return results problems.
- Add support for big endian (untested).
- Zero values are not correctly built (see below).

Make sure to count the zero number as a single digit.
Get rid of the "used" count and rely only on the digits.
Do not include the 0 digit when determining the padding.
Change the prefix append function to accommodate 0 and consistently call the prefix append function.

Update documentation comments.
39 files changed:
level_0/f_conversion/c/conversion.c
level_0/f_conversion/c/conversion.h
level_0/f_conversion/c/private-conversion.c
level_0/f_conversion/c/private-conversion.h
level_0/f_conversion/data/build/settings-mocks [new file with mode: 0644]
level_0/f_conversion/data/build/settings-tests [new file with mode: 0644]
level_0/f_conversion/data/build/testfile [new file with mode: 0644]
level_0/f_conversion/tests/c/mock-conversion.c [new file with mode: 0644]
level_0/f_conversion/tests/c/mock-conversion.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_binary.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_binary.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_decimal.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_decimal.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_duodecimal.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_duodecimal.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_hexidecimal.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_hexidecimal.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_octal.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_is_octal.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_binary.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_binary.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_decimal.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_decimal.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_duodecimal.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_duodecimal.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_hexidecimal.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_hexidecimal.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_octal.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-character_to_octal.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-number_signed_print.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-number_signed_print.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-number_signed_to_string.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-number_signed_to_string.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-number_unsigned_print.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-number_unsigned_print.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-number_unsigned_to_string.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion-number_unsigned_to_string.h [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion.c [new file with mode: 0644]
level_0/f_conversion/tests/c/test-conversion.h [new file with mode: 0644]