generated from freudenreichan/info2Praktikum-DobleSpiel
makfile tests hinzugefügt bintreeTests erstellt
This commit is contained in:
parent
33b370f0d2
commit
8c95340c77
@ -5,8 +5,23 @@
|
|||||||
void setUp(void){}
|
void setUp(void){}
|
||||||
void tearDown(void){}
|
void tearDown(void){}
|
||||||
|
|
||||||
void TEST_BINTREE{
|
void TEST_BINTREE(){
|
||||||
|
int input[8]={1,2,3,4,5,6,7,8};
|
||||||
|
int output[8];
|
||||||
|
int len = 8;
|
||||||
|
TreeNode* root = NULL;
|
||||||
|
int* isDuplicate;
|
||||||
|
|
||||||
|
for (int i = 0; i<len; i++) {
|
||||||
|
root = addToTree(root, &input[i], sizeof(int), compareFct, isDuplicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i<len; i++) {
|
||||||
|
output[i] = *(int*)nextTreeData(root);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_ASSERT_INT_ARRAY_WITHIN(0, input, output, 8);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,9 +32,11 @@ int main(){
|
|||||||
|
|
||||||
printf("\n============================\nbintree tests\n============================\n");
|
printf("\n============================\nbintree tests\n============================\n");
|
||||||
|
|
||||||
//RUN_TEST();
|
RUN_TEST(TEST_BINTREE);
|
||||||
//RUN_TEST();
|
//RUN_TEST();
|
||||||
//RUN_TEST();
|
//RUN_TEST();
|
||||||
|
|
||||||
return UNITY_END();
|
return UNITY_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Befehl zum Kompilieren: gcc bintreeTests.c bintree.h bintree.c unity/unity.c stack.c stack.h
|
||||||
14
makefile
14
makefile
@ -1,5 +1,6 @@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
FLAGS = -g -Wall -lm
|
FLAGS = -g -Wall -lm
|
||||||
|
NAMES = doble bintreeTests stackTests numbersTests
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
include makefile_windows.variables
|
include makefile_windows.variables
|
||||||
@ -36,14 +37,21 @@ $(program_obj_filesobj_files): %.o: %.c
|
|||||||
# Unit Tests
|
# Unit Tests
|
||||||
# --------------------------
|
# --------------------------
|
||||||
unitTests:
|
unitTests:
|
||||||
echo "needs to be implemented"
|
bintreeTests: stack.o bintree.o bintreeTests.c $(unityfolder)/unity.c
|
||||||
|
$(CC) $(CFLAGS) -I$(unityfolder) -o bintreeTests bintreeTests.c bintree.o stack.o $(unityfolder)/unity.c
|
||||||
|
|
||||||
|
stackTests: stack.o stackTests.c $(unityfolder)/unity.c
|
||||||
|
$(CC) $(CFLAGS) -I$(unityfolder) -o stackTests stackTests.c stack.o $(unityfolder)/unity.c
|
||||||
|
|
||||||
|
numbersTests: numbers.o numbersTests.c bintree.o stack.o $(unityfolder)/unity.c
|
||||||
|
$(CC) $(CFLAGS) -I$(unityfolder) -o numbersTests numbersTests.c numbers.o bintree.o stack.o $(unityfolder)/unity.c
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Clean
|
# Clean
|
||||||
# --------------------------
|
# --------------------------
|
||||||
clean:
|
clean:
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
del /f *.o doble
|
del /f *.o $(NAMES)
|
||||||
else
|
else
|
||||||
rm -f *.o doble
|
rm -f *.o $(NAMES)
|
||||||
endif
|
endif
|
||||||
Loading…
x
Reference in New Issue
Block a user