tests: Apply the 'return self' pattern for the L2 objects
[vpp.git] / src / vppinfra / test_macros.c
index de8f2c4..9c88507 100644 (file)
 
 #include <vppinfra/macros.h>
 
-macro_main_t macro_main;
+clib_macro_main_t clib_macro_main;
 
-int
-test_macros_main (unformat_input_t * input)
+__clib_export int
+test_macros_main (unformat_input_t *input)
 {
-  macro_main_t *mm = &macro_main;
+  clib_macro_main_t *mm = &clib_macro_main;
 
   clib_macro_init (mm);
 
   fformat (stdout, "hostname: %s\n",
-          clib_macro_eval_dollar (mm, "hostname", 1 /* complain */ ));
+          clib_macro_eval_dollar (mm, (i8 *) "hostname", 1 /* complain */ ));
 
   clib_macro_set_value (mm, "foo", "this is foo which contains $(bar)");
   clib_macro_set_value (mm, "bar", "bar");
 
   fformat (stdout, "evaluate: %s\n",
-          clib_macro_eval (mm, "returns '$(foo)'", 1 /* complain */ ));
+          clib_macro_eval (mm, (i8 *) "returns '$(foo)'", 1 /* complain */ ,
+                           0 /* recursion_level */ ,
+                           8 /* max recursion level */ ));
 
   clib_macro_free (mm);
 
@@ -46,6 +48,8 @@ main (int argc, char *argv[])
   unformat_input_t i;
   int ret;
 
+  clib_mem_init (0, 64ULL << 20);
+
   unformat_init_command_line (&i, argv);
   ret = test_macros_main (&i);
   unformat_free (&i);