test/stack_tests.c

changeset 187
7d49f179cc25
parent 185
a48428642b4e
child 192
1e51558b9d09
--- a/test/stack_tests.c	Mon Jul 28 14:44:06 2014 +0200
+++ b/test/stack_tests.c	Mon Jul 28 15:02:17 2014 +0200
@@ -29,9 +29,9 @@
 #include "stack_tests.h"
 
 #define test_ucx_stack_before \
-    char space[100]; \
+    char space[99]; \
     UcxStack stack; \
-    ucx_stack_init(&stack, space, 100) \
+    ucx_stack_init(&stack, space, 99) \
 
 UCX_TEST(test_ucx_stack_init) {
     
@@ -48,7 +48,7 @@
         "allocator not properly set");
     
     UCX_TEST_ASSERT(!stack.top && stack.space == space
-        && stack.size == 100 - 100 % sizeof(void*),
+        && stack.size == 99 - 99 % sizeof(void*),
         "struct fields not properly set");
     
     UCX_TEST_END
@@ -93,9 +93,9 @@
     
     test_ucx_stack_before;
 
-    char zeros[100];
-    memset(zeros, 0, 100);
-    memset(space, 32, 100);
+    char zeros[99];
+    memset(zeros, 0, 99);
+    memset(space, 32, 99);
     ucx_stack_calloc(&stack, 4, sizeof(int));
     
     UCX_TEST_BEGIN
@@ -139,7 +139,7 @@
     
     test_ucx_stack_before;
     
-    void *fst = ucx_stack_malloc(&stack, 10);
+    void *fst = ucx_stack_malloc(&stack, 14);
     void *snd = ucx_stack_malloc(&stack, 10);
     
     UCX_TEST_BEGIN
@@ -175,7 +175,7 @@
 UCX_TEST(test_ucx_stack_pop) {
     
     test_ucx_stack_before;
-    memset(space, 32, 100);
+    memset(space, 32, 99);
     
     void *fst = ucx_stack_malloc(&stack, 10);
     void *snd = ucx_stack_malloc(&stack, 10);

mercurial