Compare commits

..

No commits in common. "7652d3ea7de9eb03974bbd7d8a5d074ebd119a48" and "2d79193d6c47bd3c3b1730cf6ce088796c114b9b" have entirely different histories.

2 changed files with 2 additions and 30 deletions

View File

@ -26,7 +26,7 @@ TreeNode *addToTree(TreeNode *root, const void *data, size_t dataSize, CompareFc
free(newNode); //Free unused Memory
return NULL;; //Memory allocation failed
}
memcpy(newNode->data, data, dataSize); //Copy Data
newNode->data = data; //Copy Data
newNode->left = NULL;
newNode->right = NULL;
@ -74,16 +74,7 @@ void *nextTreeData(TreeNode *root)
// Releases all memory resources (including data copies).
void clearTree(TreeNode *root)
{
if(root == NULL){
return;
}
clearTree(root->right);
clearTree(root->left);
free(root->data);
free(root);
}
// Returns the number of entries in the tree given by root.

View File

@ -1,19 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include "unity.h"
#include "bintree.h"
void setUp(void){
//Use if needed
}
void tearDown(void){
//Use if needed
}
int main(){
UNITY_BEGIN();
printf("\n============================\nBintree tests\n============================\n");
}