Reduce malloc calls in stack (#78)

This commit is contained in:
Bailey Thompson
2020-08-10 12:30:51 -04:00
committed by GitHub
parent c74b0c4caf
commit af869f2b46
4 changed files with 17 additions and 50 deletions

View File

@@ -67,23 +67,9 @@ static void test_automated_trim(void)
assert(!stack_destroy(me));
}
#if STUB_MALLOC
static void test_init_out_of_memory(void)
{
fail_malloc = 1;
assert(!stack_init(sizeof(int)));
delay_fail_malloc = 1;
fail_malloc = 1;
assert(!stack_init(sizeof(int)));
}
#endif
void test_stack(void)
{
test_invalid_init();
test_basic();
test_automated_trim();
#if STUB_MALLOC
test_init_out_of_memory();
#endif
}