extern "C" {
#endif
+#ifndef _di_f_utf_char_t_codes_
+ const f_utf_char_t f_utf_char_t_eol_s = (f_utf_char_t) F_utf_char_t_eol_s;
+ const f_utf_char_t f_utf_char_t_eos_s = (f_utf_char_t) F_utf_char_t_eol_s;
+ const f_utf_char_t f_utf_char_t_placeholder_s = (f_utf_char_t) F_utf_char_t_eol_s;
+#endif // _di_f_utf_char_t_codes_
+
#ifndef _di_f_utf_space_
const uint8_t f_utf_space_em_s[F_utf_space_em_s_length] = { 0xe2, 0x80, 0x83 };
const uint8_t f_utf_space_em_quad_s[F_utf_space_em_quad_s_length] = { 0xe2, 0x80, 0x81 };
const uint8_t f_utf_substitute_middle_dot_s[F_utf_substitute_middle_dot_s_length] = { 0xc2, 0xb7 };
- const uint8_t f_utf_substitute_open_box_s[F_utf_substitute_open_box_d_length] = { 0xe2, 0x90, 0xa3 };
- const uint8_t f_utf_substitute_open_box_shouldered_s[F_utf_substitute_open_box_shouldered_d_length] = { 0xe2, 0x8d, 0xbd };
+ const uint8_t f_utf_substitute_open_box_s[F_utf_substitute_open_box_s_length] = { 0xe2, 0x90, 0xa3 };
+ const uint8_t f_utf_substitute_open_box_shouldered_s[F_utf_substitute_open_box_shouldered_s_length] = { 0xe2, 0x8d, 0xbd };
#endif // _di_f_utf_substitute_
#ifdef __cplusplus
#define F_utf_substitute_middle_dot_s_length 2
- #define F_utf_substitute_open_box_d_length 3
- #define F_utf_substitute_open_box_shouldered_d_length 3
+ #define F_utf_substitute_open_box_s_length 3
+ #define F_utf_substitute_open_box_shouldered_s_length 3
extern const uint8_t f_utf_substitute_symbol_blank_s[];
extern const uint8_t f_utf_substitute_symbol_space_s[];
#endif // _di_f_utf_char_t_
/**
- * Provide an integer that represents special characters.
+ * Provide f_utf_char_t special "characters".
*
- * Because this is an integer, the byte order matters.
+ * These strings are created via digits and then cast.
*/
#ifndef _di_f_utf_char_t_codes_
#ifdef _is_F_endian_big
- #define F_utf_char_t_eol_d 0x0000000au // 0000 0000, 0000 0000, 0000 0000, 0000 1010
- #define F_utf_char_t_eos_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
- #define F_utf_char_t_placeholder_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_t_eol_s 0x0000000au // 0000 0000, 0000 0000, 0000 0000, 0000 1010
+ #define F_utf_char_t_eos_s 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_t_placeholder_s 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
#else
- #define F_utf_char_t_eol_d 0x0a000000u // 0000 1010, 0000 0000, 0000 0000, 0000 0000
- #define F_utf_char_t_eos_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
- #define F_utf_char_t_placeholder_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_t_eol_s 0x0a000000u // 0000 1010, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_t_eos_s 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_t_placeholder_s 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
#endif // _is_F_endian_big
+
+ extern const f_utf_char_t f_utf_char_t_eol_s;
+ extern const f_utf_char_t f_utf_char_t_eos_s;
+ extern const f_utf_char_t f_utf_char_t_placeholder_s;
#endif // _di_f_utf_char_t_codes_
/**
if (!buffer.used) return F_data_not;
if (range->start > range->stop) return F_data_not_stop;
- while (buffer.string[range->start] != F_utf_char_t_eol_d) {
+ while (buffer.string[range->start] != f_utf_char_t_eol_s) {
if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
#endif // _di_f_utf_string_dynamic_seek_line_
#ifndef _di_f_utf_string_dynamic_seek_line_to_
- f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t * const range) {
+ f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const f_utf_char_t seek_to_this, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_status_set_error(F_utf);
}
- if (buffer.string[range->start] == F_utf_char_t_eol_d) return F_none_eol;
+ if (buffer.string[range->start] == f_utf_char_t_eol_s) return F_none_eol;
++range->start;
#endif // _di_f_utf_string_dynamic_seek_line_to_
#ifndef _di_f_utf_string_dynamic_seek_to_
- f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t * const range) {
+ f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const f_utf_char_t seek_to_this, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_seek_line_to_
- extern f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t * const range);
+ extern f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const f_utf_char_t seek_to_this, f_string_range_t * const range);
#endif // _di_f_utf_string_dynamic_seek_line_to_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_seek_to_
- extern f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t * const range);
+ extern f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const f_utf_char_t seek_to_this, f_string_range_t * const range);
#endif // _di_f_utf_string_dynamic_seek_to_
/**
return F_data_not_stop;
}
- while (string[range->start] != F_utf_char_t_eol_d) {
+ while (string[range->start] != f_utf_char_t_eol_s) {
if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf_fragment);
#endif // _di_f_utf_string_seek_line_
#ifndef _di_f_utf_string_seek_line_to_
- f_status_t f_utf_string_seek_line_to(const f_utf_string_t string, const f_char_t seek_to, f_string_range_t * const range) {
+ f_status_t f_utf_string_seek_line_to(const f_utf_string_t string, const f_utf_char_t seek_to, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
while (string[range->start] != seek_to) {
- if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
- return F_status_set_error(F_utf_fragment);
- }
-
- if (string[range->start] == F_utf_char_t_eol_d) {
+ if (string[range->start] == f_utf_char_t_eol_s) {
return F_none_eol;
}
#endif // _di_f_utf_string_seek_line_to_
#ifndef _di_f_utf_string_seek_to_
- f_status_t f_utf_string_seek_to(const f_utf_string_t string, const f_char_t seek_to, f_string_range_t * const range) {
+ f_status_t f_utf_string_seek_to(const f_utf_string_t string, const f_utf_char_t seek_to, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
while (string[range->start] != seek_to) {
- if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
- return F_status_set_error(F_utf_fragment);
- }
-
++range->start;
if (range->start > range->stop) {
* @param string
* The string to traverse.
* @param seek_to
- * A single-width character representing a character to seek to.
+ * A character representing a character to seek to.
* @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
- * F_utf (with error bit) if unicode is an invalid Unicode character.
- * F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_string_seek_line_to_
- extern f_status_t f_utf_string_seek_line_to(const f_utf_string_t string, const f_char_t seek_to, f_string_range_t * const range);
+ extern f_status_t f_utf_string_seek_line_to(const f_utf_string_t string, const f_utf_char_t seek_to, f_string_range_t * const range);
#endif // _di_f_utf_string_seek_line_to_
/**
* @param string
* The string to traverse.
* @param seek_to
- * A single-width character representing a character to seek to.
+ * A character representing a character to seek to.
* @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_string_seek_to_
- extern f_status_t f_utf_string_seek_to(const f_utf_string_t string, const f_char_t seek_to, f_string_range_t * const range);
+ extern f_status_t f_utf_string_seek_to(const f_utf_string_t string, const f_utf_char_t seek_to, f_string_range_t * const range);
#endif // _di_f_utf_string_seek_to_
#ifdef __cplusplus
void test__f_utf_append__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_append_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_append_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_append_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_append__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_append_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_append_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_append_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_mash__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 11);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_mash__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
{
const f_status_t status = f_utf_string_dynamic_mash(glue, source, 0);
void test__f_utf_dynamic_mash_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 9);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_mash_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
{
const f_status_t status = f_utf_string_dynamic_mash_nulless(glue, source, 0);
void test__f_utf_dynamic_mish__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 11);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_mish__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
{
const f_status_t status = f_utf_string_dynamic_mish(glue, source, 0);
void test__f_utf_dynamic_mish_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 9);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_mish_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
{
const f_status_t status = f_utf_string_dynamic_mish_nulless(glue, source, 0);
void test__f_utf_dynamic_partial_append__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_append_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_append_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_append_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_mash__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 11);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_mash__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
const f_string_range_t partial = f_string_range_t_initialize;
{
void test__f_utf_dynamic_partial_mash_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 9);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_mash_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
const f_string_range_t partial = f_string_range_t_initialize;
{
void test__f_utf_dynamic_partial_mish__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 11);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_mish__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
const f_string_range_t partial = f_string_range_t_initialize;
{
void test__f_utf_dynamic_partial_mish_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 9);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_mish_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
const f_string_range_t partial = f_string_range_t_initialize;
{
void test__f_utf_dynamic_partial_prepend__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_prepend_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_prepend_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_partial_prepend_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
void test__f_utf_dynamic_prepend__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_prepend_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_prepend_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_prepend_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_dynamic_seek_line__returns_data_not_stop(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = f_string_range_t_initialize;
void test__f_utf_dynamic_seek_line__returns_none_eos(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
void test__f_utf_dynamic_seek_line__returns_none_stop(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
void test__f_utf_dynamic_seek_line__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
void test__f_utf_dynamic_seek_line__parameter_checking(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
{
const f_status_t status = f_utf_string_dynamic_seek_line(source, 0);
extern "C" {
#endif
-void test__f_utf_dynamic_seek_line_to__at_newline(void **state) {
+void test__f_utf_dynamic_seek_line_to__after_newline(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t", 0, 6);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
}
}
+void test__f_utf_dynamic_seek_line_to__before_newline(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 2);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
void test__f_utf_dynamic_seek_line_to__returns_data_not_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = f_string_range_t_initialize;
void test__f_utf_dynamic_seek_line_to__returns_none_eos(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
void test__f_utf_dynamic_seek_line_to__returns_none_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
}
}
-void test__f_utf_dynamic_seek_line_to__works(void **state) {
-
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
-
- {
- f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
-
- const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
-
- assert_int_equal(status, F_none);
-
- assert_int_equal(range.start, 2);
- assert_int_equal(range.stop, source.used - 1);
- }
-}
-
void test__f_utf_dynamic_seek_line_to__parameter_checking(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
{
const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], 0);
#define _TEST__F_utf_dynamic_seek_line_to_h
/**
- * Test that the function works but stops at newline rather than search string.
+ * Test that the function works where seek target is after a newline.
*
* @see f_utf_string_dynamic_seek_line_to()
*/
-extern void test__f_utf_dynamic_seek_line_to__at_newline(void **state);
+extern void test__f_utf_dynamic_seek_line_to__after_newline(void **state);
+
+/**
+ * Test that the function works where seek target is before a newline.
+ *
+ * @see f_utf_string_dynamic_seek_line_to()
+ */
+extern void test__f_utf_dynamic_seek_line_to__before_newline(void **state);
/**
* Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
extern void test__f_utf_dynamic_seek_line_to__returns_none_stop(void **state);
/**
- * Test that the function works.
- *
- * @see f_utf_string_dynamic_seek_line_to()
- */
-extern void test__f_utf_dynamic_seek_line_to__works(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_utf_string_dynamic_seek_line_to()
extern "C" {
#endif
+void test__f_utf_dynamic_seek_to__after_newline(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 3);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_dynamic_seek_to__before_newline(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 2);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
void test__f_utf_dynamic_seek_to__returns_data_not_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = f_string_range_t_initialize;
void test__f_utf_dynamic_seek_to__returns_none_eos(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
void test__f_utf_dynamic_seek_to__returns_none_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
void test__f_utf_dynamic_seek_to__works(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ // Test where newline is before "X".
{
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t", 0, 6);
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
assert_int_equal(range.start, 3);
assert_int_equal(range.stop, source.used - 1);
}
+
+ // Test where newline is after "X".
+ {
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 2);
+ assert_int_equal(range.stop, source.used - 1);
+ }
}
void test__f_utf_dynamic_seek_to__parameter_checking(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
{
const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], 0);
#define _TEST__F_utf_dynamic_seek_to_h
/**
+ * Test that the function works where seek target is after a newline.
+ *
+ * @see f_utf_string_dynamic_seek_to()
+ */
+extern void test__f_utf_dynamic_seek_to__after_newline(void **state);
+
+/**
+ * Test that the function works where seek target is before a newline.
+ *
+ * @see f_utf_string_dynamic_seek_to()
+ */
+extern void test__f_utf_dynamic_seek_to__before_newline(void **state);
+
+/**
* Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
*
* @see f_utf_string_dynamic_seek_to()
extern void test__f_utf_dynamic_seek_to__returns_none_stop(void **state);
/**
- * Test that the function works.
- *
- * @see f_utf_string_dynamic_seek_to()
- */
-extern void test__f_utf_dynamic_seek_to__works(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_utf_string_dynamic_seek_to()
void test__f_utf_dynamics_append__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamics_t destination = f_utf_string_dynamics_t_initialize;
{
macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\0", 0, 9);
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize(test_value_array, 0, length_values);
{
macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\0", 0, 9);
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize(test_value_array, 0, length_values);
{
f_utf_string_map_t source = f_utf_string_map_t_initialize;
f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\0", 0, 9);
- const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\0", 0, 10);
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
+ const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e", 0, 10);
{
f_status_t status = f_utf_string_dynamic_append(test_name, &source.name);
f_utf_string_maps_t source = f_utf_string_maps_t_initialize;
f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\0", 0, 9);
- const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\0", 0, 10);
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
+ const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e", 0, 10);
{
f_status_t status = f_utf_string_maps_resize(length_inner, &source);
void test__f_utf_mash__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 11);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_mash__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
{
const f_status_t status = f_utf_string_mash(glue.string, glue.used, source.string, source.used, 0);
void test__f_utf_mash_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 9);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_mash_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
{
const f_status_t status = f_utf_string_mash_nulless(glue.string, glue.used, source.string, source.used, 0);
void test__f_utf_mish__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 11);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_mish__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
{
const f_status_t status = f_utf_string_mish(glue.string, glue.used, source.string, source.used, 0);
void test__f_utf_mish_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 9);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_mish_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0:", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
{
const f_status_t status = f_utf_string_mish_nulless(glue.string, glue.used, source.string, source.used, 0);
void test__f_utf_prepend__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_prepend_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_prepend_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_prepend_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
void test__f_utf_seek_line__returns_data_not_stop(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = f_string_range_t_initialize;
void test__f_utf_seek_line__returns_none_stop(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
void test__f_utf_seek_line__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
void test__f_utf_seek_line__parameter_checking(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
{
const f_status_t status = f_utf_string_seek_line(source.string, 0);
extern "C" {
#endif
-void test__f_utf_seek_line_to__at_newline(void **state) {
+void test__f_utf_seek_line_to__after_newline(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t", 0, 6);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
}
}
-void test__f_utf_seek_line_to__returns_data_not_stop(void **state) {
+void test__f_utf_seek_line_to__before_newline(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
{
- f_string_range_t range = f_string_range_t_initialize;
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
- assert_int_equal(status, F_data_not_stop);
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 2);
+ assert_int_equal(range.stop, source.used - 1);
}
}
-void test__f_utf_seek_line_to__returns_none_stop(void **state) {
+void test__f_utf_seek_line_to__returns_data_not_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
- f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = f_string_range_t_initialize;
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
- assert_int_equal(status, F_none_stop);
-
- assert_int_equal(range.start, source.used);
- assert_int_equal(range.stop, source.used - 1);
+ assert_int_equal(status, F_data_not_stop);
}
}
-void test__f_utf_seek_line_to__works(void **state) {
+void test__f_utf_seek_line_to__returns_none_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t", 0, 4);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
- assert_int_equal(status, F_none);
+ assert_int_equal(status, F_none_stop);
- assert_int_equal(range.start, 2);
+ assert_int_equal(range.start, source.used);
assert_int_equal(range.stop, source.used - 1);
}
}
void test__f_utf_seek_line_to__parameter_checking(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
{
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], 0);
#define _TEST__F_utf_seek_line_to_h
/**
- * Test that the function works but stops at newline rather than search string.
+ * Test that the function works where seek target is after a newline.
*
* @see f_utf_string_seek_line_to()
*/
-extern void test__f_utf_seek_line_to__at_newline(void **state);
+extern void test__f_utf_seek_line_to__after_newline(void **state);
/**
- * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ * Test that the function works where seek target is before a newline.
*
* @see f_utf_string_seek_line_to()
*/
-extern void test__f_utf_seek_line_to__returns_data_not_stop(void **state);
+extern void test__f_utf_seek_line_to__before_newline(void **state);
/**
- * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
*
* @see f_utf_string_seek_line_to()
*/
-extern void test__f_utf_seek_line_to__returns_none_stop(void **state);
+extern void test__f_utf_seek_line_to__returns_data_not_stop(void **state);
/**
- * Test that the function works.
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
*
* @see f_utf_string_seek_line_to()
*/
-extern void test__f_utf_seek_line_to__works(void **state);
+extern void test__f_utf_seek_line_to__returns_none_stop(void **state);
/**
* Test that the function correctly fails on invalid parameter.
extern "C" {
#endif
-void test__f_utf_seek_to__returns_data_not_stop(void **state) {
+void test__f_utf_seek_to__after_newline(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t", 0, 6);
{
- f_string_range_t range = f_string_range_t_initialize;
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
- assert_int_equal(status, F_data_not_stop);
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 3);
+ assert_int_equal(range.stop, source.used - 1);
}
}
-void test__f_utf_seek_to__returns_none_stop(void **state) {
+void test__f_utf_seek_to__before_newline(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
- assert_int_equal(status, F_none_stop);
+ assert_int_equal(status, F_none);
- assert_int_equal(range.start, source.used);
+ assert_int_equal(range.start, 2);
assert_int_equal(range.stop, source.used - 1);
}
}
-void test__f_utf_seek_to__works(void **state) {
+void test__f_utf_seek_to__returns_data_not_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
+
+ {
+ f_string_range_t range = f_string_range_t_initialize;
+
+ const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
+
+ assert_int_equal(status, F_data_not_stop);
+ }
+}
+
+void test__f_utf_seek_to__returns_none_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r", 0, 10);
{
f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
- assert_int_equal(status, F_none);
+ assert_int_equal(status, F_none_stop);
- assert_int_equal(range.start, 3);
+ assert_int_equal(range.start, source.used);
assert_int_equal(range.stop, source.used - 1);
}
}
void test__f_utf_seek_to__parameter_checking(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t", 0, 6);
{
const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], 0);
#define _TEST__F_utf_seek_to_h
/**
- * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ * Test that the function works where seek target is after a newline.
*
* @see f_utf_string_seek_to()
*/
-extern void test__f_utf_seek_to__returns_data_not_stop(void **state);
+extern void test__f_utf_seek_to__after_newline(void **state);
/**
- * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ * Test that the function works where seek target is before a newline.
*
* @see f_utf_string_seek_to()
*/
-extern void test__f_utf_seek_to__returns_none_stop(void **state);
+extern void test__f_utf_seek_to__before_newline(void **state);
/**
- * Test that the function works.
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
*
* @see f_utf_string_seek_to()
*/
-extern void test__f_utf_seek_to__works(void **state);
+extern void test__f_utf_seek_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_utf_string_seek_to()
+ */
+extern void test__f_utf_seek_to__returns_none_stop(void **state);
/**
* Test that the function correctly fails on invalid parameter.
void test__f_utf_triples_append__works(void **state) {
- const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "a\0\0\0", 0, 1);
- const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "b\0\0\0", 0, 1);
- const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "c\0\0\0", 0, 1);
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0a", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0b", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0c", 0, 1);
const f_utf_string_triple_t source = macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c);
f_utf_string_triples_t destination = f_utf_string_triples_t_initialize;
const int length_sources = 2;
- const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "a\0\0\0", 0, 1);
- const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "b\0\0\0", 0, 1);
- const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "c\0\0\0", 0, 1);
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0a", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0b", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0c", 0, 1);
- const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "d\0\0\0", 0, 1);
- const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "e\0\0\0", 0, 1);
- const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "f\0\0\0", 0, 1);
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0d", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0e", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0f", 0, 1);
f_utf_string_triple_t sources_array[] = {
macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
const int length_sources = 2;
- const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "a\0\0\0", 0, 1);
- const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "b\0\0\0", 0, 1);
- const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "c\0\0\0", 0, 1);
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0a", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0b", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0c", 0, 1);
- const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "d\0\0\0", 0, 1);
- const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "e\0\0\0", 0, 1);
- const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "f\0\0\0", 0, 1);
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0d", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0e", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0f", 0, 1);
f_utf_string_triple_t sources_array[] = {
macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
const int length_sources = 2;
const int length_sources_set = 2;
- const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "a\0\0\0", 0, 1);
- const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "b\0\0\0", 0, 1);
- const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "c\0\0\0", 0, 1);
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0a", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0b", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0c", 0, 1);
- const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "d\0\0\0", 0, 1);
- const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "e\0\0\0", 0, 1);
- const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "f\0\0\0", 0, 1);
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0d", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0e", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0f", 0, 1);
- const f_utf_string_static_t test_g = macro_f_utf_string_static_t_initialize((f_utf_string_t) "g\0\0\0", 0, 1);
- const f_utf_string_static_t test_h = macro_f_utf_string_static_t_initialize((f_utf_string_t) "h\0\0\0", 0, 1);
- const f_utf_string_static_t test_i = macro_f_utf_string_static_t_initialize((f_utf_string_t) "i\0\0\0", 0, 1);
+ const f_utf_string_static_t test_g = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0g", 0, 1);
+ const f_utf_string_static_t test_h = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0h", 0, 1);
+ const f_utf_string_static_t test_i = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0i", 0, 1);
- const f_utf_string_static_t test_j = macro_f_utf_string_static_t_initialize((f_utf_string_t) "j\0\0\0", 0, 1);
- const f_utf_string_static_t test_k = macro_f_utf_string_static_t_initialize((f_utf_string_t) "k\0\0\0", 0, 1);
- const f_utf_string_static_t test_l = macro_f_utf_string_static_t_initialize((f_utf_string_t) "l\0\0\0", 0, 1);
+ const f_utf_string_static_t test_j = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0j", 0, 1);
+ const f_utf_string_static_t test_k = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0k", 0, 1);
+ const f_utf_string_static_t test_l = macro_f_utf_string_static_t_initialize((f_utf_string_t) "\0\0\0l", 0, 1);
f_utf_string_triple_t sources_array1[] = {
macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
cmocka_unit_test(test__f_utf_dynamic_seek_line__returns_none_stop),
cmocka_unit_test(test__f_utf_dynamic_seek_line__works),
- cmocka_unit_test(test__f_utf_dynamic_seek_line_to__at_newline),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line_to__after_newline),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line_to__before_newline),
cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_data_not_stop),
cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_none_eos),
cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_none_stop),
- cmocka_unit_test(test__f_utf_dynamic_seek_line_to__works),
+ cmocka_unit_test(test__f_utf_dynamic_seek_to__after_newline),
+ cmocka_unit_test(test__f_utf_dynamic_seek_to__before_newline),
cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_data_not_stop),
cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_none_eos),
cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_none_stop),
- cmocka_unit_test(test__f_utf_dynamic_seek_to__works),
cmocka_unit_test(test__f_utf_dynamic_terminate__appends_null),
cmocka_unit_test(test__f_utf_dynamic_terminate__doesnt_append_null),
cmocka_unit_test(test__f_utf_seek_line__returns_none_stop),
cmocka_unit_test(test__f_utf_seek_line__works),
- cmocka_unit_test(test__f_utf_seek_line_to__at_newline),
+ cmocka_unit_test(test__f_utf_seek_line_to__after_newline),
+ cmocka_unit_test(test__f_utf_seek_line_to__before_newline),
cmocka_unit_test(test__f_utf_seek_line_to__returns_data_not_stop),
cmocka_unit_test(test__f_utf_seek_line_to__returns_none_stop),
- cmocka_unit_test(test__f_utf_seek_line_to__works),
+ cmocka_unit_test(test__f_utf_seek_to__after_newline),
+ cmocka_unit_test(test__f_utf_seek_to__before_newline),
cmocka_unit_test(test__f_utf_seek_to__returns_data_not_stop),
cmocka_unit_test(test__f_utf_seek_to__returns_none_stop),
- cmocka_unit_test(test__f_utf_seek_to__works),
#ifndef _di_level_0_parameter_checking_
cmocka_unit_test(test__f_utf_append__parameter_checking),
while (buffer.string[range->start] != seek_to_character) {
- if (buffer.string[range->start++] == F_utf_char_t_eol_d) {
+ if (buffer.string[range->start++] == f_utf_char_t_eol_s) {
return F_none_eol;
}
return status;
}
- if (buffer.string[range->start++] == F_utf_char_t_eol_d) {
+ if (buffer.string[range->start++] == f_utf_char_t_eol_s) {
return F_none_eol;
}
while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == F_false) {
if (F_status_is_error(status)) return status;
- if (buffer.string[range->start] == F_utf_char_t_eol_d) return F_none_eol;
+ if (buffer.string[range->start] == f_utf_char_t_eol_s) return F_none_eol;
++range->start;
return F_status_set_error(F_utf);
}
- if (string[range->start] == F_utf_char_t_eol_d) {
+ if (string[range->start] == f_utf_char_t_eol_s) {
return F_none_eol;
}
return status;
}
- if (string[range->start++] == F_utf_char_t_eol_d) {
+ if (string[range->start++] == f_utf_char_t_eol_s) {
return F_none_eol;
}
return status;
}
- if (string[range->start++] == F_utf_char_t_eol_d) {
+ if (string[range->start++] == f_utf_char_t_eol_s) {
return F_none_eol;
}