]> Kevux Git Server - fll/commit
Update: Unit tests for f_utf and relating changes or bug fixes.
authorKevin Day <thekevinday@gmail.com>
Fri, 17 Jun 2022 03:56:34 +0000 (22:56 -0500)
committerKevin Day <thekevinday@gmail.com>
Fri, 17 Jun 2022 04:27:57 +0000 (23:27 -0500)
commitd00a6090c1ab35ba44fc53d12abc45e97da31d93
treec8a52f754d284442ee3337fc5b1ce7e11cc421de
parent6be200a8713b0f77d645392305738a9e214cdc26
Update: Unit tests for f_utf and relating changes or bug fixes.

Fix several problems exposed by unit tests.
Fix several unit tests to work as expected due to problems with the data files.

At some point I seem to have diverged from always ensuring that the f_utf_char_t is always big-endian.
I probably got lost in ensuring the differences between big and little endian that I ended up making the f_utf_char_t act little-endian in cases where host is little-endian.
The f_utf_char_t must always be big-endian.
However, there are cases where the big and little endian behavior must be processed.
Break up the macros into having "_be" and "_le" to make this possible.

The iscntrl() check return value needs to be explicitly handled to ensure that only F_false or F_true is returned.
This is already fixed in one function already.
Apply the existing fix to the other function.

The f_utf_char_t should be seen as a single character rather than a stream of bytes.
Unit tests now treat any non-zero value after the designated width as invalid.
The is valid checking code now tests for this invalid case.

The unit tests are improved.
Test for F_true and F_false rather than calling assert_true() and assert_false().
Error bits and other status codes were previously passing when they should fail due to the use of assert_true() and assert_false().

This commit changes the byte order of the f_utf_char_t.
This will break code such as the code used in the utf8 program.
A follow up commit is necessary to fix any byte order problems.
57 files changed:
level_0/f_utf/c/private-utf_combining.c
level_0/f_utf/c/private-utf_control.c
level_0/f_utf/c/private-utf_digit.c
level_0/f_utf/c/private-utf_emoji.c
level_0/f_utf/c/private-utf_phonetic.c
level_0/f_utf/c/private-utf_punctuation.c
level_0/f_utf/c/private-utf_subscript.c
level_0/f_utf/c/private-utf_superscript.c
level_0/f_utf/c/private-utf_symbol.c
level_0/f_utf/c/private-utf_valid.c
level_0/f_utf/c/utf/common.h
level_0/f_utf/c/utf/is.c
level_0/f_utf/c/utf/is_character.c
level_0/f_utf/c/utf/is_character.h
level_0/f_utf/data/tests/bytesequences/combining-all.txt
level_0/f_utf/data/tests/bytesequences/emoji-all.txt
level_0/f_utf/data/tests/bytesequences/superscript-all.txt
level_0/f_utf/data/tests/codepoints/combining-all.txt
level_0/f_utf/data/tests/codepoints/emoji-all.txt
level_0/f_utf/tests/unit/c/data-utf.c
level_0/f_utf/tests/unit/c/data-utf.h
level_0/f_utf/tests/unit/c/test-utf-character_is_alphabetic.c
level_0/f_utf/tests/unit/c/test-utf-character_is_combining.c
level_0/f_utf/tests/unit/c/test-utf-character_is_control.c
level_0/f_utf/tests/unit/c/test-utf-character_is_digit.c
level_0/f_utf/tests/unit/c/test-utf-character_is_emoji.c
level_0/f_utf/tests/unit/c/test-utf-character_is_numeric.c
level_0/f_utf/tests/unit/c/test-utf-character_is_phonetic.c
level_0/f_utf/tests/unit/c/test-utf-character_is_private.c
level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.c
level_0/f_utf/tests/unit/c/test-utf-character_is_subscript.c
level_0/f_utf/tests/unit/c/test-utf-character_is_superscript.c
level_0/f_utf/tests/unit/c/test-utf-character_is_surrogate.c
level_0/f_utf/tests/unit/c/test-utf-character_is_symbol.c
level_0/f_utf/tests/unit/c/test-utf-character_is_valid.c
level_0/f_utf/tests/unit/c/test-utf-character_is_whitespace.c
level_0/f_utf/tests/unit/c/test-utf-character_is_wide.c
level_0/f_utf/tests/unit/c/test-utf-character_is_word.c
level_0/f_utf/tests/unit/c/test-utf-character_is_zero_width.c
level_0/f_utf/tests/unit/c/test-utf-is_alphabetic.c
level_0/f_utf/tests/unit/c/test-utf-is_combining.c
level_0/f_utf/tests/unit/c/test-utf-is_control.c
level_0/f_utf/tests/unit/c/test-utf-is_digit.c
level_0/f_utf/tests/unit/c/test-utf-is_emoji.c
level_0/f_utf/tests/unit/c/test-utf-is_numeric.c
level_0/f_utf/tests/unit/c/test-utf-is_phonetic.c
level_0/f_utf/tests/unit/c/test-utf-is_private.c
level_0/f_utf/tests/unit/c/test-utf-is_punctuation.c
level_0/f_utf/tests/unit/c/test-utf-is_subscript.c
level_0/f_utf/tests/unit/c/test-utf-is_superscript.c
level_0/f_utf/tests/unit/c/test-utf-is_surrogate.c
level_0/f_utf/tests/unit/c/test-utf-is_symbol.c
level_0/f_utf/tests/unit/c/test-utf-is_valid.c
level_0/f_utf/tests/unit/c/test-utf-is_whitespace.c
level_0/f_utf/tests/unit/c/test-utf-is_wide.c
level_0/f_utf/tests/unit/c/test-utf-is_word.c
level_0/f_utf/tests/unit/c/test-utf-is_zero_width.c