#include #include #include "stack.h" #include "unity.h" void test_push(void) { int value = 3; TEST_ASSERT_NOT_NULL(push(NULL, &value)); TEST_ASSERT_EQUAL_INT(value, (intptr_t) push(NULL, &value)->value); } void test_pop(void) { TEST_ASSERT_NULL(pop(NULL)); } void test_top(void) { TEST_ASSERT_NULL(top(NULL)); } void test_clear(void) { // TEST_ASSERT_NULL(clearStack(NULL)); } void setUp(void) { // Falls notwendig, kann hier Vorbereitungsarbeit gemacht werden } void tearDown(void) { // Hier kann Bereinigungsarbeit nach jedem Test durchgeführt werden } int main() { UNITY_BEGIN(); printf("============================\nStack tests\n============================\n"); RUN_TEST(test_push); RUN_TEST(test_pop); RUN_TEST(test_top); RUN_TEST(test_clear); return UNITY_END(); }