Added second test, not yet running fully

This commit is contained in:
Lukas Weber 2025-12-03 12:41:05 +01:00
parent 036158fc59
commit c663833b6e

View File

@ -18,6 +18,21 @@ void test_firstNodeAddedCorrectly(void) {
clearStack(testStack); clearStack(testStack);
} }
void test_topReturnsCorrectValues(void) {
printf("Starting second test...\n");
StackNode* testStack = NULL;
int data1 = 1;
testStack = push(testStack, &data1);
int data2 = 0;
testStack = push(testStack, &data2);
int data3 = 3;
testStack = push(testStack, &data3);
TEST_ASSERT_EQUAL_INT(1, *(int*)testStack->stackData);
TEST_ASSERT_EQUAL_INT(0, *(int*)testStack->stackData);
TEST_ASSERT_EQUAL_INT(3, *(int*)testStack->stackData);
clearStack(testStack);
}
void setUp(void) { void setUp(void) {
} }
@ -32,6 +47,7 @@ int main(void) {
printf("\n----------------------------Stack-Tests----------------------------\n"); printf("\n----------------------------Stack-Tests----------------------------\n");
RUN_TEST(test_firstNodeAddedCorrectly); RUN_TEST(test_firstNodeAddedCorrectly);
RUN_TEST(test_topReturnsCorrectValues);
return UNITY_END(); return UNITY_END();
} }