diff options
Diffstat (limited to 'unittests.c')
-rw-r--r-- | unittests.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/unittests.c b/unittests.c index 61a59bb..0ba5b33 100644 --- a/unittests.c +++ b/unittests.c @@ -253,19 +253,6 @@ static int test_new_returns_NULL_upon_first_allocation_failure(void) } -static int test_new_returns_NULL_upon_second_allocation_failure(void) -{ - Dynstr *dynstr; - - dynstr_init(); - dynstr_set_malloc(fail_malloc); - fail_malloc_after = 1; - dynstr = dynstr_new_empty(); - FAIL_UNLESS_EQUAL(dynstr, NULL); - return true; -} - - static int test_creates_from_cstring(void) { const char bytes[] = "asdfasdfafdasdfasdfqw4tb"; @@ -541,6 +528,7 @@ static int test_cats_ok(void) a = new_from_cstring("abc"); b = new_from_cstring("def"); c = dynstr_cat(a, b); + FAIL_UNLESS_EQUAL(dynstr_len(c), 6); size = dynstr_memcpy(buf, c, 0, dynstr_len(c)); FAIL_UNLESS_EQUAL(size, 6); FAIL_UNLESS_EQUAL(memcmp(buf, "abcdef", 6), 0); @@ -564,22 +552,6 @@ static int test_cat_returns_NULL_for_first_malloc_failure(void) } -static int test_cat_returns_NULL_for_second_malloc_failure(void) -{ - Dynstr *a; - Dynstr *b; - Dynstr *c; - - a = new_from_cstring("abc"); - b = new_from_cstring("def"); - dynstr_set_malloc(fail_malloc); - fail_malloc_after = 1; - c = dynstr_cat(a, b); - FAIL_UNLESS_EQUAL(c, NULL); - return true; -} - - static int test_byteat_reports_correct_character(void) { Dynstr *dynstr; @@ -1239,7 +1211,6 @@ static const struct test tests[] = { TEST(test_abort_handler_calls_abort), TEST(test_empty_string_is_empty), TEST(test_new_returns_NULL_upon_first_allocation_failure), - TEST(test_new_returns_NULL_upon_second_allocation_failure), TEST(test_creates_from_cstring), TEST(test_creates_from_memory), TEST(test_creates_from_constant_cstring), @@ -1258,7 +1229,6 @@ static const struct test tests[] = { TEST(test_copies_partial_substring_when_length_too_big), TEST(test_cats_ok), TEST(test_cat_returns_NULL_for_first_malloc_failure), - TEST(test_cat_returns_NULL_for_second_malloc_failure), TEST(test_byteat_reports_correct_character), TEST(test_byteat_reports_error_for_too_large_offset), TEST(test_byteat_reports_0xff_correctly), |