Skip to content

Commit

Permalink
bxtrs test
Browse files Browse the repository at this point in the history
  • Loading branch information
tsjensen committed Oct 14, 2023
1 parent d3ebe3c commit dd393c5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions utest/bxstring_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,22 @@ void test_bxs_rtrim_empty(void **state)



void test_bxs_prepend_spaces_null(void **state)
{
UNUSED(state);

bxstr_t *actual = bxs_prepend_spaces(NULL, 2);
assert_non_null(actual);
assert_string_equal(" ", actual->ascii);
assert_int_equal(2, (int) actual->num_chars);
assert_int_equal(2, (int) actual->num_chars_visible);
assert_int_equal(0, (int) actual->num_chars_invisible);

bxs_free(actual);
}



void test_bxs_append_spaces(void **state)
{
UNUSED(state);
Expand Down
2 changes: 2 additions & 0 deletions utest/bxstring_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ void test_bxs_ltrim_max(void **state);
void test_bxs_rtrim(void **state);
void test_bxs_rtrim_empty(void **state);

void test_bxs_prepend_spaces_null(void **state);

void test_bxs_append_spaces(void **state);

void test_bxs_to_output(void **state);
Expand Down
1 change: 1 addition & 0 deletions utest/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ int main(void)
cmocka_unit_test_setup(test_bxs_ltrim_max, beforeTest),
cmocka_unit_test_setup(test_bxs_rtrim, beforeTest),
cmocka_unit_test_setup(test_bxs_rtrim_empty, beforeTest),
cmocka_unit_test_setup(test_bxs_prepend_spaces_null, beforeTest),
cmocka_unit_test_setup(test_bxs_append_spaces, beforeTest),
cmocka_unit_test_setup(test_bxs_to_output, beforeTest),
cmocka_unit_test_setup(test_bxs_is_empty_null, beforeTest),
Expand Down

0 comments on commit dd393c5

Please sign in to comment.