提交 c2868dbf authored 作者: colm's avatar colm 提交者: Mike Jerris

FS-9775: update dht bucket tests

上级 2c3b0748
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
ks_dhtrt_routetable_t* rt; ks_dhtrt_routetable_t* rt;
ks_pool_t* pool; ks_pool_t* pool;
ks_thread_pool_t* tpool;
static ks_thread_t *threads[10]; static ks_thread_t *threads[10];
...@@ -28,10 +30,10 @@ void test01() ...@@ -28,10 +30,10 @@ void test01()
printf("*** testbuckets - test01 start\n"); fflush(stdout); printf("*** testbuckets - test01 start\n"); fflush(stdout);
ks_dhtrt_routetable_t* rt; ks_dhtrt_routetable_t* rt;
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
ks_dhtrt_deinitroute(&rt); ks_dhtrt_deinitroute(&rt);
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
ks_dht_nodeid_t nodeid, homeid; ks_dht_nodeid_t nodeid, homeid;
memset(homeid.id, 0xdd, KS_DHT_NODEID_SIZE); memset(homeid.id, 0xdd, KS_DHT_NODEID_SIZE);
homeid.id[19] = 0; homeid.id[19] = 0;
...@@ -472,6 +474,7 @@ int main(int argc, char* argv[]) { ...@@ -472,6 +474,7 @@ int main(int argc, char* argv[]) {
ks_init(); ks_init();
ks_global_set_default_logger(7); ks_global_set_default_logger(7);
ks_thread_pool_create(&tpool, KS_DHT_TPOOL_MIN, KS_DHT_TPOOL_MAX, KS_DHT_TPOOL_STACK, KS_PRI_NORMAL, KS_DHT_TPOOL_IDLE);
ks_status_t status; ks_status_t status;
char *str = NULL; char *str = NULL;
...@@ -488,41 +491,41 @@ int main(int argc, char* argv[]) { ...@@ -488,41 +491,41 @@ int main(int argc, char* argv[]) {
printf("init/deinit routeable\n"); fflush(stdout); printf("init/deinit routeable\n"); fflush(stdout);
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
ks_dhtrt_deinitroute(&rt); ks_dhtrt_deinitroute(&rt);
if (tests[1] == 1) { if (tests[1] == 1) {
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
test01(); test01();
ks_dhtrt_deinitroute(&rt); ks_dhtrt_deinitroute(&rt);
} }
if (tests[2] == 1) { if (tests[2] == 1) {
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
test02(); test02();
ks_dhtrt_deinitroute(&rt); ks_dhtrt_deinitroute(&rt);
} }
if (tests[3] == 1) { if (tests[3] == 1) {
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
test03(); test03();
ks_dhtrt_deinitroute(&rt); ks_dhtrt_deinitroute(&rt);
} }
if (tests[4] == 1) { if (tests[4] == 1) {
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
test04(); test04();
ks_dhtrt_deinitroute(&rt); ks_dhtrt_deinitroute(&rt);
} }
if (tests[5] == 1) { if (tests[5] == 1) {
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
test05(); test05();
ks_dhtrt_deinitroute(&rt); ks_dhtrt_deinitroute(&rt);
} }
if (tests[6] == 1) { if (tests[6] == 1) {
ks_dhtrt_initroute(&rt, pool); ks_dhtrt_initroute(&rt, pool, tpool);
test06(); test06();
ks_dhtrt_deinitroute(&rt); ks_dhtrt_deinitroute(&rt);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论