static void test1(void) { int i; test1_init(); for (i=0; i<1024; i++) { struct node1 *n = test1_lookup(i); ASSERT(n->data == i+123); } for (i=1; i<1024; i+=2) { struct node1 *n = test1_lookup(i); test1_remove(n); } for (i=0; i<1024; i++) { struct node1 *n = test1_find(i); if (!n != (i&1) || (n && n->data != i+123)) die("Inconsistency at i=%d", i); } i=0; HASH_FOR_ALL(test1, n) { i += 1 + n->key; }
// gcc test1.c node.c thread.c list.c -o test1 -g -lpthread int main() { node_manager_t *node_manager; srand(time(NULL)); node_manager_init(&node_manager,255,20); //test1_init); test1_init(node_manager); node_manager_thread_prm_t node_manager_thread_prm; node_manager_thread_prm.num_of_steps = 59000; node_manager_thread_prm.node_manager = node_manager; node_manager_start(node_manager,&node_manager_thread_prm); while(1) { if (kbhit()) break; } }
int main() { test1_init(&test1); test2_init(&test2); test1.fpfoo(); test2.fpfoo(); return 0; }
test1::test1() { m_pForm = (Control *) test1_init (); }