test/stack_tests.c

changeset 187
7d49f179cc25
parent 185
a48428642b4e
child 192
1e51558b9d09
     1.1 --- a/test/stack_tests.c	Mon Jul 28 14:44:06 2014 +0200
     1.2 +++ b/test/stack_tests.c	Mon Jul 28 15:02:17 2014 +0200
     1.3 @@ -29,9 +29,9 @@
     1.4  #include "stack_tests.h"
     1.5  
     1.6  #define test_ucx_stack_before \
     1.7 -    char space[100]; \
     1.8 +    char space[99]; \
     1.9      UcxStack stack; \
    1.10 -    ucx_stack_init(&stack, space, 100) \
    1.11 +    ucx_stack_init(&stack, space, 99) \
    1.12  
    1.13  UCX_TEST(test_ucx_stack_init) {
    1.14      
    1.15 @@ -48,7 +48,7 @@
    1.16          "allocator not properly set");
    1.17      
    1.18      UCX_TEST_ASSERT(!stack.top && stack.space == space
    1.19 -        && stack.size == 100 - 100 % sizeof(void*),
    1.20 +        && stack.size == 99 - 99 % sizeof(void*),
    1.21          "struct fields not properly set");
    1.22      
    1.23      UCX_TEST_END
    1.24 @@ -93,9 +93,9 @@
    1.25      
    1.26      test_ucx_stack_before;
    1.27  
    1.28 -    char zeros[100];
    1.29 -    memset(zeros, 0, 100);
    1.30 -    memset(space, 32, 100);
    1.31 +    char zeros[99];
    1.32 +    memset(zeros, 0, 99);
    1.33 +    memset(space, 32, 99);
    1.34      ucx_stack_calloc(&stack, 4, sizeof(int));
    1.35      
    1.36      UCX_TEST_BEGIN
    1.37 @@ -139,7 +139,7 @@
    1.38      
    1.39      test_ucx_stack_before;
    1.40      
    1.41 -    void *fst = ucx_stack_malloc(&stack, 10);
    1.42 +    void *fst = ucx_stack_malloc(&stack, 14);
    1.43      void *snd = ucx_stack_malloc(&stack, 10);
    1.44      
    1.45      UCX_TEST_BEGIN
    1.46 @@ -175,7 +175,7 @@
    1.47  UCX_TEST(test_ucx_stack_pop) {
    1.48      
    1.49      test_ucx_stack_before;
    1.50 -    memset(space, 32, 100);
    1.51 +    memset(space, 32, 99);
    1.52      
    1.53      void *fst = ucx_stack_malloc(&stack, 10);
    1.54      void *snd = ucx_stack_malloc(&stack, 10);

mercurial