Browse code

Fix a test

Nat! authored on 06/11/2016 21:41:03
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+1.1.1
2
+===
3
+
4
+* fix a test
5
+
1 6
 1.1.0
2 7
 ===
3 8
 
... ...
@@ -35,7 +35,7 @@
35 35
 #define mulle_concurrent_h__
36 36
 
37 37
 
38
-#define MULLE_CONCURRENT_VERSION  ((1 << 20) | (1 << 8) | 0)
38
+#define MULLE_CONCURRENT_VERSION  ((1 << 20) | (1 << 8) | 1)
39 39
 
40 40
 #include <mulle_thread/mulle_thread.h>
41 41
 #include <mulle_allocator/mulle_allocator.h>
... ...
@@ -47,21 +47,10 @@ static void  insert_something( struct mulle_concurrent_pointerarray *map)
47 47
    int    rval;
48 48
 
49 49
    do
50
-      value = (void *) (rand() << 1); // no uneven pointer values
50
+      value = (void *) (intptr_t) (rand() << 1); // no uneven pointer values
51 51
    while( ! value);
52 52
 
53
-   rval = mulle_concurrent_pointerarray_add( map, value);
54
-
55
-   switch( rval)
56
-   {
57
-   default :
58
-      perror( "_mulle_concurrentpointerarray_add");
59
-      abort();
60
-
61
-   case 0 :
62
-   case EEXIST :
63
-      return;
64
-   }
53
+   mulle_concurrent_pointerarray_add( map, value);
65 54
 }
66 55
 
67 56
 
... ...
@@ -180,11 +169,7 @@ static void  single_threaded_test( void)
180 180
       for( i = 1; i <= 100; i++)
181 181
       {
182 182
          value = (void *) (i * 10);
183
-         if( _mulle_concurrent_pointerarray_add( &map, value))
184
-         {
185
-            perror( "_mulle_concurrent_pointerarray_add");
186
-            abort();
187
-         }
183
+         _mulle_concurrent_pointerarray_add( &map, value);
188 184
          assert( mulle_concurrent_pointerarray_get( &map, i - 1) == (void *) (i * 10));
189 185
       }
190 186