]> pd.if.org Git - nbds/blobdiff - test/map_test2.c
more header file refactoring
[nbds] / test / map_test2.c
index 92a269ec4f81fdd699327e096aad2ed0e2048a60..51b17b3f10cbf7f75eabdb8cbc7ea1260198f216 100644 (file)
@@ -12,6 +12,9 @@
 #include "runtime.h"
 #include "nstring.h"
 #include "map.h"
+#include "list.h"
+#include "skiplist.h"
+#include "hashtable.h"
 #include "lwt.h"
 
 #define ASSERT_EQUAL(x, y) CuAssertIntEquals(tc, x, y)
@@ -25,7 +28,7 @@ typedef struct worker_data {
     volatile int *wait;
 } worker_data_t;
 
-static map_type_t map_type_;
+static const map_impl_t *map_type_;
 
 // Test some basic stuff; add a few keys, remove a few keys
 void simple (CuTest* tc) {
@@ -199,7 +202,7 @@ int main (void) {
     nbd_init();
     lwt_set_trace_level("h3");
 
-    map_type_t map_types[] = { MAP_TYPE_LIST, MAP_TYPE_SKIPLIST, MAP_TYPE_HASHTABLE };
+    static const map_impl_t *map_types[] = { &ll_map_impl, &sl_map_impl, &ht_map_impl };
     for (int i = 0; i < sizeof(map_types)/sizeof(*map_types); ++i) {
         map_type_ = map_types[i];