generated from freudenreichan/info2Praktikum-DobleSpiel
Testkopefe geschrieben
This commit is contained in:
parent
b3c9fec7ba
commit
bc24ca7b46
48
binTreeTest.c
Normal file
48
binTreeTest.c
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "bintree.h"
|
||||||
|
#include "unity.h"
|
||||||
|
|
||||||
|
static int compare(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
return (*(int *)a > *(int *)b) - (*(int *)a < *(int *)b); // a und b werden in int konvertiert und deren Werte miteinander verglichen
|
||||||
|
// returns 1 for a>b or -1 for a<b
|
||||||
|
// in bintree.c wird ueberprueft, ob compare eine positive oder eine negative Zahl zurueckgibt,
|
||||||
|
// wenn a groeßer b, positiv und dann wird links nach Teilbauemen gesucht
|
||||||
|
}
|
||||||
|
|
||||||
|
void setUp() {}
|
||||||
|
void tearDown() {}
|
||||||
|
|
||||||
|
//Adds a single element to the tree
|
||||||
|
void add_single_element_to_Tree()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Adds multiplie elements to a tree, just one element should be in the tree twice
|
||||||
|
void add_multiple_elements_to_Tree()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Detects the size of a tree
|
||||||
|
void detect_size()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Tests, wether one duplicate is in the tree
|
||||||
|
void detect_duplicate()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//Traverses the three inorder to check wether nextTreeData works
|
||||||
|
void whole_tree()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//Tests, wether whole tree is deleted from memory
|
||||||
|
void delete_tree()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
4
stack.h
4
stack.h
@ -11,8 +11,8 @@ The latest element is taken from the stack. */
|
|||||||
typedef{
|
typedef{
|
||||||
void* data;
|
void* data;
|
||||||
struct StackNode *next;
|
struct StackNode *next;
|
||||||
}StackNode;cmd
|
}StackNode;
|
||||||
|
|
||||||
|
|
||||||
// Pushes data as pointer onto the stack.
|
// Pushes data as pointer onto the stack.
|
||||||
StackNode *push(StackNode *stack, void *data);
|
StackNode *push(StackNode *stack, void *data);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user