From: Mike Lowis Date: Fri, 11 Dec 2015 15:59:56 +0000 (+0000) Subject: Added simple posix compliant makefile X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=31f7fc90f63ce3169ccdacffed6415e7f590400d;p=projs%2Flibcds.git Added simple posix compliant makefile --- diff --git a/Makefile b/Makefile index b92a1fd..acb912b 100644 --- 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 \ diff --git a/source/exn/exn.c b/source/exn/exn.c index 8d7497a..7712352 100755 --- a/source/exn/exn.c +++ b/source/exn/exn.c @@ -5,11 +5,6 @@ #include "exn.h" #include -#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; diff --git a/source/mem/mem.c b/source/mem/mem.c index dae4729..a7a1267 100644 --- a/source/mem/mem.c +++ b/source/mem/mem.c @@ -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!"); diff --git a/source/rbt/rbt.c b/source/rbt/rbt.c index 9687659..899a79d 100644 --- a/source/rbt/rbt.c +++ b/source/rbt/rbt.c @@ -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); diff --git a/tests/main.c b/tests/main.c index 786939a..6a0acbf 100644 --- a/tests/main.c +++ b/tests/main.c @@ -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(); diff --git a/tests/test_exn.c b/tests/test_exn.c index e08bd61..64c4119 100644 --- a/tests/test_exn.c +++ b/tests/test_exn.c @@ -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 index 9bc92e6..0000000 --- a/tests/test_mem.c +++ /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 ); - } -}