X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=tests%2Ftest-bitmap.c;h=3dbc8df6f9853b925f047bc4e450a1779971dae5;hb=d1a74e5e4ff438f805e94ead2440c5f3fa56ffdc;hp=932133252a6e5ac2d25238d13214db2994bd6219;hpb=3f636c7e22945652e0e2553894598fa24a5d5f6f;p=cascardo%2Fovs.git diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c index 932133252..3dbc8df6f 100644 --- a/tests/test-bitmap.c +++ b/tests/test-bitmap.c @@ -121,7 +121,7 @@ run_test(void (*function)(void)) } static void -run_tests(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +run_tests(struct ovs_cmdl_context *ctx OVS_UNUSED) { run_test(test_bitmap_equal); run_test(test_bitmap_scan); @@ -129,9 +129,9 @@ run_tests(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) } static void -run_benchmarks(int argc OVS_UNUSED, char *argv[]) +run_benchmarks(struct ovs_cmdl_context *ctx) { - int n_iter = strtol(argv[1], NULL, 10); + int n_iter = strtol(ctx->argv[1], NULL, 10); struct timeval start; xgettimeofday(&start); @@ -148,7 +148,7 @@ run_benchmarks(int argc OVS_UNUSED, char *argv[]) printf("\n"); } -static const struct command commands[] = { +static const struct ovs_cmdl_command commands[] = { {"check", NULL, 0, 0, run_tests}, {"benchmark", NULL, 1, 1, run_benchmarks}, {NULL, NULL, 0, 0, NULL}, @@ -157,8 +157,13 @@ static const struct command commands[] = { static void test_bitmap_main(int argc, char *argv[]) { + struct ovs_cmdl_context ctx = { + .argc = argc - 1, + .argv = argv + 1, + }; + set_program_name(argv[0]); - run_command(argc - 1, argv + 1, commands); + ovs_cmdl_run_command(&ctx, commands); } OVSTEST_REGISTER("test-bitmap", test_bitmap_main);