generated from freudenreichan/info2Praktikum-DobleSpiel
stack test Speicheroptimierung Nachtrag
This commit is contained in:
parent
8ef242ae9b
commit
7c89058ff1
Binary file not shown.
@ -13,6 +13,9 @@ static void pushNeuerStack(){
|
|||||||
int gespeicherterWert = *(int*)(tester->data);
|
int gespeicherterWert = *(int*)(tester->data);
|
||||||
TEST_ASSERT_EQUAL_INT(*(int*)(tester->data),2);
|
TEST_ASSERT_EQUAL_INT(*(int*)(tester->data),2);
|
||||||
TEST_ASSERT_TRUE(tester->dannach == NULL);
|
TEST_ASSERT_TRUE(tester->dannach == NULL);
|
||||||
|
|
||||||
|
|
||||||
|
clearStack(tester);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pushVorhandenerStack(){
|
static void pushVorhandenerStack(){
|
||||||
@ -27,6 +30,9 @@ static void pushVorhandenerStack(){
|
|||||||
int gespeicherterWert = *(int*)(stack->data);
|
int gespeicherterWert = *(int*)(stack->data);
|
||||||
TEST_ASSERT_EQUAL_INT(*(int*)(stack->data),2);
|
TEST_ASSERT_EQUAL_INT(*(int*)(stack->data),2);
|
||||||
TEST_ASSERT_EQUAL_INT(*(int*)(stack->dannach->data),1);
|
TEST_ASSERT_EQUAL_INT(*(int*)(stack->dannach->data),1);
|
||||||
|
|
||||||
|
|
||||||
|
clearStack(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -43,6 +49,7 @@ void testTop(){
|
|||||||
TEST_ASSERT_EQUAL_INT(2, *(int *)top(stack)); // top sollte b sein
|
TEST_ASSERT_EQUAL_INT(2, *(int *)top(stack)); // top sollte b sein
|
||||||
|
|
||||||
|
|
||||||
|
clearStack(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testPop(void) {
|
void testPop(void) {
|
||||||
@ -64,6 +71,8 @@ void testPop(void) {
|
|||||||
stack = pop(stack);
|
stack = pop(stack);
|
||||||
TEST_ASSERT_NULL(stack); // leerer Stack nach pop
|
TEST_ASSERT_NULL(stack); // leerer Stack nach pop
|
||||||
|
|
||||||
|
|
||||||
|
clearStack(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testPopLeererStack(void) {
|
void testPopLeererStack(void) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user