|
Blender V4.3
|
#include "testing/testing.h"#include "BLI_rand.h"#include "BLI_string.h"#include "BLI_string_cursor_utf8.h"#include "BLI_string_utf8.h"#include "BLI_utildefines.h"Go to the source code of this file.
Macros | |
| #define | STR_MB_ALPHA_1 "\x41" |
| #define | STR_MB_ALPHA_2 "\xc2\xaa" |
| #define | STR_MB_ALPHA_3 "\xe0\xa0\x80" |
| #define | STR_MB_ALPHA_4 "\xf0\x90\x80\x80" |
| #define | STR_MB_ALPHA_5 "\xf8\x80\x80\x80\x80" |
| #define | STR_MB_ALPHA_6 "\xfc\x80\x80\x80\x80\x80" |
| #define | EXPECT_BYTE_OFFSET(truncate_ofs, expect_nchars) |
Functions | |
Test #BLI_strnlen_utf8 | |
| TEST (string, StringNLenUTF8) | |
| TEST (string, StringNLenUTF8_Incomplete) | |
Test #BLI_str_utf8_offset_from_index | |
| TEST (string, Utf8OffsetFromIndex_ClampedIndex) | |
Test #BLI_str_utf8_as_unicode_step_safe | |
| static size_t | utf8_as_char32 (const char *str, const char str_len, char32_t *r_result) |
| template<size_t Size, size_t SizeWithPadding> | |
| void | utf8_as_char32_test_compare_with_pad_bytes (const char utf8_src[Size]) |
| template<size_t Size> | |
| void | utf8_as_char32_test_compare (const char utf8_src[Size]) |
| template<size_t Size> | |
| void | utf8_as_char32_test_at_buffer_size () |
| TEST (string, Utf8AsUnicodeStep) | |
Test #BLI_str_cursor_step_next_utf32_empty | |
| TEST (string, StrCursorStepNextUtf32Empty) | |
Test #BLI_str_cursor_step_next_utf32_single | |
| TEST (string, StrCursorStepNextUtf32Single) | |
Test #BLI_str_cursor_step_next_utf32_simple | |
| TEST (string, StrCursorStepNextUtf32Simple) | |
Test #BLI_str_cursor_step_next_utf32_allcombining | |
| TEST (string, StrCursorStepNextUtf32AllCombining) | |
Test #BLI_str_cursor_step_next_utf32_complex | |
| TEST (string, StrCursorStepNextUtf32Complex) | |
Test #BLI_str_cursor_step_next_utf32_invalid | |
| TEST (string, StrCursorStepNextUtf32Invalid) | |
Test #BLI_str_cursor_step_prev_utf32_empty | |
| TEST (string, StrCursorStepPrevUtf32Empty) | |
Test #BLI_str_cursor_step_prev_utf32_single | |
| TEST (string, StrCursorStepPrevUtf32Single) | |
Test #BLI_str_cursor_step_prev_utf32_simple | |
| TEST (string, StrCursorStepPrevUtf32Simple) | |
Test #BLI_str_cursor_step_prev_utf32_allcombining | |
| TEST (string, StrCursorStepPrevUtf32AllCombining) | |
Test #BLI_str_cursor_step_prev_utf32_complex | |
| TEST (string, StrCursorStepPrevUtf32Complex) | |
Test #BLI_str_cursor_step_prev_utf32_invalid | |
| TEST (string, StrCursorStepPrevUtf32Invalid) | |
Test #BLI_str_cursor_step_next_utf8_empty | |
| TEST (string, StrCursorStepNextUtf8Empty) | |
Test #BLI_str_cursor_step_next_utf8_single | |
| TEST (string, StrCursorStepNextUtf8Single) | |
Test #BLI_str_cursor_step_next_utf8_simple | |
| TEST (string, StrCursorStepNextUtf8Simple) | |
Test #BLI_str_cursor_step_next_utf8_allcombining | |
| TEST (string, StrCursorStepNextUtf8AllCombining) | |
Test #BLI_str_cursor_step_next_utf8_complex | |
| TEST (string, StrCursorStepNextUtf8AllComplex) | |
Test #BLI_str_cursor_step_next_utf8_invalid | |
| TEST (string, StrCursorStepNextUtf8Invalid) | |
Test #BLI_str_cursor_step_prev_utf8_empty | |
| TEST (string, StrCursorStepPrevUtf8Empty) | |
Test #BLI_str_cursor_step_prev_utf8_single | |
| TEST (string, StrCursorStepPrevUtf8Single) | |
| TEST (string, StrCursorStepPrevUtf8Simple) | |
Test #BLI_str_cursor_step_prev_utf8_allcombining | |
| TEST (string, StrCursorStepPrevUtf8AllCombining) | |
Test #BLI_str_cursor_step_prev_utf8_complex | |
| TEST (string, StrCursorStepPrevUtf8Complex) | |
Test #BLI_str_cursor_step_prev_utf8_invalid | |
| TEST (string, StrCursorStepPrevUtf8Invalid) | |
Test #BLI_str_utf8_invalid_strip | |
| static const char * | utf8_invalid_tests [][3] |
| TEST (string, Utf8InvalidBytes) | |
| #define EXPECT_BYTE_OFFSET | ( | truncate_ofs, | |
| expect_nchars ) |
Referenced by TEST().
| #define STR_MB_ALPHA_1 "\x41" |
Multi byte defies, use when the exact character isn't important, and when proper handling of multi-byte sequences is needed.
Define the first text character found in 1-4 bytes. We might want to generate other string tables too.
Definition at line 52 of file BLI_string_utf8_test.cc.
| #define STR_MB_ALPHA_2 "\xc2\xaa" |
Definition at line 53 of file BLI_string_utf8_test.cc.
| #define STR_MB_ALPHA_3 "\xe0\xa0\x80" |
Definition at line 54 of file BLI_string_utf8_test.cc.
| #define STR_MB_ALPHA_4 "\xf0\x90\x80\x80" |
Definition at line 55 of file BLI_string_utf8_test.cc.
| #define STR_MB_ALPHA_5 "\xf8\x80\x80\x80\x80" |
Definition at line 61 of file BLI_string_utf8_test.cc.
Referenced by TEST().
| #define STR_MB_ALPHA_6 "\xfc\x80\x80\x80\x80\x80" |
Definition at line 62 of file BLI_string_utf8_test.cc.
| TEST | ( | string | , |
| StrCursorStepNextUtf32AllCombining | ) |
Definition at line 589 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf32Complex | ) |
Definition at line 609 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf32Empty | ) |
Definition at line 539 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf32Invalid | ) |
Definition at line 634 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf32Simple | ) |
Definition at line 571 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf32Single | ) |
Definition at line 555 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf8AllCombining | ) |
Definition at line 834 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf8AllComplex | ) |
Definition at line 860 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf8Empty | ) |
Definition at line 786 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf8Invalid | ) |
Definition at line 895 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf8(), EXPECT_EQ(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf8Simple | ) |
Definition at line 816 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepNextUtf8Single | ) |
Definition at line 801 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_next_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf32AllCombining | ) |
Definition at line 711 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf32Complex | ) |
Definition at line 731 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf32Empty | ) |
Definition at line 665 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf32Invalid | ) |
Definition at line 756 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf32Simple | ) |
Definition at line 694 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf32Single | ) |
Definition at line 679 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf32(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf8AllCombining | ) |
Definition at line 974 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf8Complex | ) |
Definition at line 1000 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf8Empty | ) |
Definition at line 926 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf8Invalid | ) |
Definition at line 1035 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf8Simple | ) |
Definition at line 957 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf8(), len, and pos.
| TEST | ( | string | , |
| StrCursorStepPrevUtf8Single | ) |
Definition at line 942 of file BLI_string_utf8_test.cc.
References BLI_str_cursor_step_prev_utf8(), len, and pos.
| TEST | ( | string | , |
| StringNLenUTF8 | ) |
Definition at line 346 of file BLI_string_utf8_test.cc.
References BLI_strnlen_utf8(), EXPECT_EQ(), and STR_MB_ALPHA_6.
| TEST | ( | string | , |
| StringNLenUTF8_Incomplete | ) |
Definition at line 353 of file BLI_string_utf8_test.cc.
References EXPECT_BYTE_OFFSET, STR_MB_ALPHA_1, STR_MB_ALPHA_2, STR_MB_ALPHA_3, STR_MB_ALPHA_4, STR_MB_ALPHA_5, and STR_MB_ALPHA_6.
| TEST | ( | string | , |
| Utf8AsUnicodeStep | ) |
Definition at line 515 of file BLI_string_utf8_test.cc.
References utf8_as_char32_test_at_buffer_size().
| TEST | ( | string | , |
| Utf8InvalidBytes | ) |
Definition at line 322 of file BLI_string_utf8_test.cc.
References BLI_str_utf8_invalid_strip(), EXPECT_EQ(), int, printf, and utf8_invalid_tests.
| TEST | ( | string | , |
| Utf8OffsetFromIndex_ClampedIndex | ) |
Definition at line 406 of file BLI_string_utf8_test.cc.
References ARRAY_SIZE, BLI_str_utf8_offset_from_index(), BLI_strlen_utf8(), EXPECT_EQ(), str, STR_MB_ALPHA_1, STR_MB_ALPHA_2, STR_MB_ALPHA_3, and STR_MB_ALPHA_4.
|
static |
Definition at line 437 of file BLI_string_utf8_test.cc.
References BLI_str_utf8_as_unicode_step_safe(), and str.
Referenced by utf8_as_char32_test_compare_with_pad_bytes().
| void utf8_as_char32_test_at_buffer_size | ( | ) |
Definition at line 481 of file BLI_string_utf8_test.cc.
References BLI_rng_free(), BLI_rng_get_char_n(), BLI_rng_new(), int, mul(), and utf8_as_char32_test_compare().
Referenced by TEST().
| void utf8_as_char32_test_compare | ( | const char | utf8_src[Size] | ) |
Definition at line 472 of file BLI_string_utf8_test.cc.
References utf8_as_char32_test_compare_with_pad_bytes().
Referenced by utf8_as_char32_test_at_buffer_size().
| void utf8_as_char32_test_compare_with_pad_bytes | ( | const char | utf8_src[Size] | ) |
Definition at line 447 of file BLI_string_utf8_test.cc.
References EXPECT_EQ(), and utf8_as_char32().
Referenced by utf8_as_char32_test_compare().
|
static |
Definition at line 77 of file BLI_string_utf8_test.cc.
Referenced by TEST().