test_set_u64.c (480B)
1 #include <stdlib.h> 2 #include <stdio.h> 3 #include <assert.h> 4 #include "set_u64.h" 5 6 static void test_set_u64_init() { 7 set_u64_t s; 8 9 set_u64_init(&s); 10 assert(s.nelts == 0); 11 assert(s.nalloc == SET_U64_DEFAULT_SIZE); 12 assert(LIST_EMPTY(&(s.head[0]))); 13 14 set_u64_clear(&s); 15 16 set_u64_init_size(&s, 23); 17 assert(s.nelts == 0); 18 assert(s.nalloc == 23); 19 assert(LIST_EMPTY(&(s.head[0]))); 20 21 set_u64_clear(&s); 22 } 23 24 int main() { 25 test_set_u64_init(); 26 27 printf("test ok\n"); 28 }