generated from freudenreichan/info2Praktikum-DobleSpiel
Test
This commit is contained in:
parent
a6996b4d35
commit
7f1c02d1c2
37
doblespiel/test_stack.c
Normal file
37
doblespiel/test_stack.c
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "stack.h"
|
||||||
|
|
||||||
|
int draufundentfernen(StackNode *stack){
|
||||||
|
|
||||||
|
//erst ein paar stacks drauf oben
|
||||||
|
int i = 3;
|
||||||
|
int j = 8;
|
||||||
|
int m = 2;
|
||||||
|
push(stack, i);
|
||||||
|
if (top(stack) !=i)
|
||||||
|
{printf("Fehler");}
|
||||||
|
|
||||||
|
push(stack, j);
|
||||||
|
if (top(stack) !=j)
|
||||||
|
{printf("Fehler");}
|
||||||
|
push(stack, m);
|
||||||
|
if (top(stack) !=m)
|
||||||
|
{printf("Fehler");}
|
||||||
|
if (top(stack) ==j)
|
||||||
|
{printf("auf stack hat geklappt");
|
||||||
|
}
|
||||||
|
//dann alle wieder entfernen
|
||||||
|
pop(stack);
|
||||||
|
if (top(stack) !=j)
|
||||||
|
{printf("Fehler");}
|
||||||
|
pop(stack);
|
||||||
|
if (top(stack) !=m)
|
||||||
|
{printf("Fehler");}
|
||||||
|
pop(stack);
|
||||||
|
if (top(stack) !=i)
|
||||||
|
{printf("Fehler");}
|
||||||
|
printf("Drauf und runter funtkioniert!");
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user