diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-11-14 23:09:57 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-11-14 23:09:57 +0300 |
commit | 239ea5f3e998ef4aca873aba5ac6668eaa252b35 (patch) | |
tree | 9c2d7a34a79acde6955f511d2960becec0bc433d | |
parent | 796b2a627a958576c403673f92797a5306e6677e (diff) | |
download | libatomic_ops-239ea5f3e998ef4aca873aba5ac6668eaa252b35.tar.gz |
Do not define print_list() unless used (tests)
* tests/test_malloc.c (print_list): Define only if DEBUG_RUN_ONE_TEST.
* tests/test_stack.c (print_list): Define only if VERBOSE.
-rw-r--r-- | tests/test_malloc.c | 2 | ||||
-rw-r--r-- | tests/test_stack.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_malloc.c b/tests/test_malloc.c index dca06da..e9d924a 100644 --- a/tests/test_malloc.c +++ b/tests/test_malloc.c @@ -95,6 +95,7 @@ ln *cons(int d, ln *tail) return result; } +#ifdef DEBUG_RUN_ONE_TEST void print_list(ln *l) { ln *p; @@ -105,6 +106,7 @@ void print_list(ln *l) } printf("\n"); } +#endif /* DEBUG_RUN_ONE_TEST */ /* Check that l contains numbers from m to n inclusive in ascending order */ void check_list(ln *l, int m, int n) diff --git a/tests/test_stack.c b/tests/test_stack.c index c21a881..0847c11 100644 --- a/tests/test_stack.c +++ b/tests/test_stack.c @@ -96,6 +96,7 @@ void add_elements(int n) AO_stack_push(&the_list, (AO_t *)le); } +#ifdef VERBOSE void print_list(void) { list_element *p; @@ -105,6 +106,7 @@ void print_list(void) p = (list_element *)AO_REAL_NEXT_PTR(p -> next)) printf("%d\n", p -> data); } +#endif /* VERBOSE */ static char marks[MAX_NTHREADS * (MAX_NTHREADS + 1) / 2 + 1]; |