X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=test%2Fmap_test2.c;h=8ab2b6fd7cd6bdf11edc1e47fa8ced1733a9b58b;hb=973c2b13fe82d6ebd030cd58869fa237b1fe5370;hp=f9444ca0077999c18a1f58f2dea19283219112c9;hpb=c7c053b290f15b7c8ba4f7327ead5a6fe836ec80;p=nbds diff --git a/test/map_test2.c b/test/map_test2.c index f9444ca..8ab2b6f 100644 --- a/test/map_test2.c +++ b/test/map_test2.c @@ -20,6 +20,7 @@ #include "hashtable.h" #include "lwt.h" #include "mem.h" +#include "rcu.h" #define ASSERT_EQUAL(x, y) CuAssertIntEquals(tc, x, y) @@ -137,7 +138,7 @@ void *add_remove_worker (void *arg) { int d = wd->id; int iters = 10000; - SYNC_ADD(wd->wait, -1); + (void)SYNC_ADD(wd->wait, -1); do { } while (*wd->wait); // wait for all workers to be ready map_key_t key; @@ -315,11 +316,9 @@ void big_iteration_test (CuTest* tc) { } int main (void) { + lwt_set_trace_level("H3m3l2t0"); - nbd_init(); - lwt_set_trace_level("h3"); - - static const map_impl_t *map_types[] = { &ll_map_impl, &sl_map_impl, &ht_map_impl }; + static const map_impl_t *map_types[] = { &MAP_IMPL_LL, &MAP_IMPL_SL, &MAP_IMPL_HT }; for (int i = 0; i < sizeof(map_types)/sizeof(*map_types); ++i) { map_type_ = map_types[i]; @@ -327,10 +326,10 @@ int main (void) { CuString *output = CuStringNew(); CuSuite* suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, concurrent_add_remove_test); SUITE_ADD_TEST(suite, basic_test); SUITE_ADD_TEST(suite, basic_iteration_test); SUITE_ADD_TEST(suite, big_iteration_test); - SUITE_ADD_TEST(suite, concurrent_add_remove_test); CuSuiteRun(suite); CuSuiteDetails(suite, output);