Fix vppinfra unit tests 62/762/2
authorFlorin Coras <[email protected]>
Tue, 12 Apr 2016 22:05:27 +0000 (00:05 +0200)
committerGerrit Code Review <[email protected]>
Thu, 14 Apr 2016 14:09:49 +0000 (14:09 +0000)
"make check" in build-root/build-$tag-$arch/vppinfra should now work on a
machine with 3G of spare memory

Change-Id: Ie6a22e8496b56b93aa90fdc81e3e0c10dc7514fb
Signed-off-by: Florin Coras <[email protected]>
vppinfra/vppinfra/test_elf.c
vppinfra/vppinfra/test_random.c
vppinfra/vppinfra/test_slist.c

index d3145b6..914513a 100644 (file)
@@ -166,8 +166,11 @@ int main (int argc, char * argv[])
        }
     }
 
-  if (! tm->input_file)
-    clib_error ("no input file");
+  if (!tm->input_file)
+    {
+      clib_warning("No input file! Using test_bihash_template");
+      tm->input_file = "test_bihash_template";
+    }
 
   error = elf_read_file (em, tm->input_file);
   if (error)
index f54e0c1..9cf0726 100644 (file)
@@ -54,7 +54,7 @@ int test_random_main (unformat_input_t * input)
   uword print;
   u32 seed;
   u32 *seedp = &seed;
-  
+
   /* first, check known sequence from Numerical Recipes in C, 2nd ed.
      page 284 */
   seed = known_random_sequence[0];
@@ -127,6 +127,8 @@ int main (int argc, char * argv[])
   unformat_input_t i;
   int ret;
 
+  clib_mem_init (0, 3ULL<<30);
+
   unformat_init_command_line (&i, argv);
   ret = test_random_main (&i);
   unformat_free (&i);
index 76ba5dc..7a02153 100644 (file)
@@ -158,7 +158,7 @@ int test_slist_main (unformat_input_t *input)
   u32 tmp;
 
   tm->seed = 0xbabeb00b;
-  tm->iter = 10000000;
+  tm->iter = 100000;
   tm->verbose = 1;
   tm->branching_factor = 1.0 / 5.0;
 
@@ -200,7 +200,7 @@ int main (int argc, char * argv[])
   unformat_input_t i;
   int ret;
 
-  clib_mem_init (0, (u64)8<<30);
+  clib_mem_init (0, (u64)4<<30);
 
   unformat_init_command_line (&i, argv);
   ret = test_slist_main (&i);