command-line: add ovs_cmdl_ prefix
[cascardo/ovs.git] / tests / test-heap.c
index 3e0940c..5340860 100644 (file)
 /* A test for for functions and macros declared in heap.h. */
 
 #include <config.h>
+#undef NDEBUG
 #include "heap.h"
+#include <assert.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <stdlib.h>
 #include "command-line.h"
+#include "ovstest.h"
 #include "random.h"
 #include "util.h"
-#include "ovstest.h"
-
-#undef NDEBUG
-#include <assert.h>
 
 /* Sample heap element. */
 struct element {
@@ -464,17 +463,18 @@ test_heap_raw_delete(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
     }
 }
 
-static const struct command commands[] = {
-    { "insert-delete-same-order", 0, 0, test_heap_insert_delete_same_order, },
-    { "insert-delete-reverse-order", 0, 0,
+static const struct ovs_cmdl_command commands[] = {
+    { "insert-delete-same-order", NULL, 0, 0,
+      test_heap_insert_delete_same_order, },
+    { "insert-delete-reverse-order", NULL, 0, 0,
       test_heap_insert_delete_reverse_order, },
-    { "insert-delete-every-order", 0, 0,
+    { "insert-delete-every-order", NULL, 0, 0,
       test_heap_insert_delete_every_order, },
-    { "insert-delete-same-order-with-dups", 0, 0,
+    { "insert-delete-same-order-with-dups", NULL, 0, 0,
       test_heap_insert_delete_same_order_with_dups, },
-    { "raw-insert", 0, 0, test_heap_raw_insert, },
-    { "raw-delete", 0, 0, test_heap_raw_delete, },
-    { NULL, 0, 0, NULL, },
+    { "raw-insert", NULL, 0, 0, test_heap_raw_insert, },
+    { "raw-delete", NULL, 0, 0, test_heap_raw_delete, },
+    { NULL, NULL, 0, 0, NULL, },
 };
 
 static void
@@ -482,7 +482,7 @@ test_heap_main(int argc, char *argv[])
 {
     set_program_name(argv[0]);
 
-    run_command(argc - 1, argv + 1, commands);
+    ovs_cmdl_run_command(argc - 1, argv + 1, commands);
 }
 
-OVSTEST_REGISTER("test-heap", test_heap_main, commands);
+OVSTEST_REGISTER("test-heap", test_heap_main);