+ if (test_chisquare ())
+ return (-1);
+
+ /* Simple randomness tests based on X2 stats */
+ vec_validate (counts, 255);
+
+ for (i = 0; i < 1000000; i++)
+ {
+ u32 random_index;
+ u32 r = random_u32 (&seed);
+
+ random_index = r & 0xFF;
+
+ counts[random_index]++;
+ }
+
+ d = clib_chisquare (counts);
+
+ fformat (stdout, "%d random octets, chisquare stat d = %.3f\n", i, d);
+
+ vec_free (counts);
+