diff --git a/bintree.o b/bintree.o deleted file mode 100644 index 861d2b2..0000000 Binary files a/bintree.o and /dev/null differ diff --git a/doble.exe b/doble.exe index 85ea193..a41304b 100644 Binary files a/doble.exe and b/doble.exe differ diff --git a/doble_initial.exe b/doble_initial.exe index 3db2f66..74ae298 100644 Binary files a/doble_initial.exe and b/doble_initial.exe differ diff --git a/highscore.o b/highscore.o deleted file mode 100644 index e9b31f1..0000000 Binary files a/highscore.o and /dev/null differ diff --git a/highscores.txt b/highscores.txt index 6977b89..bddb71b 100644 --- a/highscores.txt +++ b/highscores.txt @@ -1,2 +1,4 @@ player_name;5967 +player_name;4698 +player_name;2994 jan;2993 diff --git a/main.o b/main.o deleted file mode 100644 index a5219de..0000000 Binary files a/main.o and /dev/null differ diff --git a/numbers.o b/numbers.o deleted file mode 100644 index 247f8c4..0000000 Binary files a/numbers.o and /dev/null differ diff --git a/stack.o b/stack.o deleted file mode 100644 index 381a8d2..0000000 Binary files a/stack.o and /dev/null differ diff --git a/test_stack.exe b/test_stack.exe index 92e047f..4ec5bd2 100644 Binary files a/test_stack.exe and b/test_stack.exe differ diff --git a/test_tree.c b/test_tree.c deleted file mode 100644 index 6c1ab69..0000000 --- a/test_tree.c +++ /dev/null @@ -1,118 +0,0 @@ -#include "unity.h" -#include "bintree.h" -#include -#include - -static int compare(const void *a, const void *b) -{ - return (*(int *)a > *(int *)b) - (*(int *)a < *(int *)b); -} - -void setUp(void) { } -void tearDown(void) { } - -void test_addToTree_single_element(void) -{ - TreeNode *root = NULL; - int value = 10; - int dup; - - root = addToTree(root, &value, sizeof(int), compare, &dup); - - TEST_ASSERT_NOT_NULL(root); - TEST_ASSERT_EQUAL_INT(10, *(int*)root->data); - TEST_ASSERT_EQUAL_INT(0, dup); - - clearTree(root); -} - -void test_addToTree_multiple_elements_and_size(void) -{ - TreeNode *root = NULL; - int values[] = {5, 3, 7, 1, 4}; - int dup; - - for (int i = 0; i < 5; i++) - root = addToTree(root, &values[i], sizeof(int), compare, &dup); - - TEST_ASSERT_EQUAL_UINT(5, treeSize(root)); - - clearTree(root); -} - -void test_addToTree_duplicate_detection(void) -{ - TreeNode *root = NULL; - int val = 42; - int dup; - - root = addToTree(root, &val, sizeof(int), compare, &dup); - TEST_ASSERT_EQUAL_INT(0, dup); - - root = addToTree(root, &val, sizeof(int), compare, &dup); - TEST_ASSERT_EQUAL_INT(1, dup); - - clearTree(root); -} - -void test_treeSize_empty_tree_detection(void) -{ - TEST_ASSERT_EQUAL_UINT(0, treeSize(NULL)); -} - -void test_nextTreeData_returns_inorder(void) -{ - TreeNode *root = NULL; - int values[] = {5, 3, 7, 2, 4, 6, 8}; - - for (int i = 0; i < 7; i++) - root = addToTree(root, &values[i], sizeof(int), compare, NULL); - - int expected[] = {2,3,4,5,6,7,8}; - - int idx = 0; - void *p = nextTreeData(root); - - while (p != NULL) - { - TEST_ASSERT_EQUAL_INT(expected[idx], *(int*)p); - idx++; - p = nextTreeData(NULL); - } - - TEST_ASSERT_EQUAL_INT(7, idx); - - clearTree(root); -} - -void test_treeSize_returns_correct_size() -{ - TreeNode *root = NULL; - int values[] = {8, 3, 10, 1, 6, 14}; - - for (int i = 0; i < 6; i++) - root = addToTree(root, &values[i], sizeof(int), compare, NULL); - - TEST_ASSERT_EQUAL_UINT(6, treeSize(root)); - - clearTree(root); - root = NULL; - - TEST_ASSERT_EQUAL_UINT(0, treeSize(root)); -} - -int main(void) -{ - UNITY_BEGIN(); - - printf("\n============================\n Bintree tests\n============================\n"); - - RUN_TEST(test_addToTree_single_element); - RUN_TEST(test_addToTree_multiple_elements_and_size); - RUN_TEST(test_addToTree_duplicate_detection); - RUN_TEST(test_treeSize_empty_tree_detection); - RUN_TEST(test_nextTreeData_returns_inorder); - RUN_TEST(test_treeSize_returns_correct_size); - - return UNITY_END(); -} diff --git a/timer.o b/timer.o deleted file mode 100644 index 5af0f96..0000000 Binary files a/timer.o and /dev/null differ