]> git.mdlowis.com Git - projs/libcds.git/commitdiff
Added simple posix compliant makefile
authorMike Lowis <mike.lowis@gentex.com>
Fri, 11 Dec 2015 15:59:56 +0000 (15:59 +0000)
committerMike Lowis <mike.lowis@gentex.com>
Fri, 11 Dec 2015 15:59:56 +0000 (15:59 +0000)
Makefile
source/exn/exn.c
source/mem/mem.c
source/rbt/rbt.c
tests/main.c
tests/test_exn.c
tests/test_mem.c [deleted file]

index b92a1fd1b2d8544fedd152accf7f7c093c0d2dd0..acb912b2b6c70d7ec044a1c7120ffe8aba2d27fe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,6 @@ TEST_SRCS = tests/main.c      \
             tests/test_list.c \
             tests/test_exn.c  \
             tests/test_str.c  \
-            tests/test_mem.c  \
             tests/test_set.c  \
             tests/test_vec.c  \
             tests/test_rbt.c  \
index 8d7497a3651ca06226af9ae297511acf688a5b39..77123527b8fecbad0cde9ebc0db3b465237bfcdc 100755 (executable)
@@ -5,11 +5,6 @@
 #include "exn.h"
 #include <stdio.h>
 
-#ifdef TESTING
-extern void test_exit(int);
-#define exit(status) test_exit(status)
-#endif
-
 typedef struct exn_stack_t {
     struct exn_stack_t* p_next;
     exn_handler_t handler;
index dae47292d8c9f270a3c6e3e1da64e75e89c91c4c..a7a12679555cfb7311f5d8d99f487820189b7733 100644 (file)
@@ -20,9 +20,6 @@ size_t Num_Allocations = 0;
 #endif
 
 #if (LEAK_DETECT_LEVEL > 0)
-#ifndef TESTING
-static
-#endif
 void summarize_leaks(void) {
     if(Num_Allocations > 0) {
         puts("Warning: Memory leak(s) detected!");
index 96876590fa0d71c6db7dab856998be6ca2a5827e..899a79d30047abc53bcdeed14cff59cad4c81e43 100644 (file)
@@ -40,9 +40,6 @@ static void rbt_node_free(void* v_node){
     if(node->right) mem_release(node->right);
 }
 
-#ifndef TESTING
-static
-#endif
 rbt_node_t* rbt_node_new(void* contents){
     rbt_node_t* node = mem_allocate(sizeof(rbt_node_t), &rbt_node_free);
     node->left = NULL;
@@ -57,9 +54,6 @@ rbt_node_t* rbt_node_new(void* contents){
 /* ---------------------------------------- */
 /*    informational / querying functions    */
 /* ---------------------------------------- */
-#ifndef TESTING
-static
-#endif
 rbt_color_t rbt_node_color(rbt_node_t* node){
     //leaves are NULL and black implicitly
     return (node ? node->color : BLACK);
index 786939a0dcc1f9875b7d2c70b34f77f726c8992e..6a0acbf49c93abf8c461b2f72924ddcad28e9003 100644 (file)
@@ -10,7 +10,6 @@ int main(int argc, char** argv)
     RUN_TEST_SUITE(String);
     RUN_TEST_SUITE(RBT);
     RUN_TEST_SUITE(Exn);
-    RUN_TEST_SUITE(Mem);
     RUN_TEST_SUITE(Set);
     RUN_TEST_SUITE(Map);
     return PRINT_TEST_RESULTS();
index e08bd61e334fb6b99dcc84ed76ab5c2d055743e8..64c4119e6b9adc03814076294c2a806874ed369e 100644 (file)
@@ -17,7 +17,7 @@ typedef struct {
 } exn_test_state_t;
 
 static int Exit_Status = 0;
-void test_exit(int status) {
+void exit(int status) {
     Exit_Status = status;
     if (NULL != exn_handler())
         exn_handler()->state = EXN_DONE;
diff --git a/tests/test_mem.c b/tests/test_mem.c
deleted file mode 100644 (file)
index 9bc92e6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Unit Test Framework Includes
-#include "test.h"
-
-// File To Test
-#include "mem.h"
-
-static void test_setup(void) { }
-
-//-----------------------------------------------------------------------------
-// Begin Unit Tests
-//-----------------------------------------------------------------------------
-TEST_SUITE(Mem) {
-    TEST(Verify_mem_can_summarize_leaks)
-    {
-        void* p_obj = mem_allocate(sizeof(4),NULL);
-        extern void summarize_leaks(void);
-        summarize_leaks();
-        mem_release( p_obj );
-    }
-}