Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / vm / page-shuffle.c
1 #include <stdbool.h>
2 #include "tests/arc4.h"
3 #include "tests/cksum.h"
4 #include "tests/lib.h"
5 #include "tests/main.h"
6
7 #define SIZE (128 * 1024)
8
9 static char buf[SIZE];
10
11 void
12 test_main (void)
13 {
14   size_t i;
15
16   /* Initialize. */
17   for (i = 0; i < sizeof buf; i++)
18     buf[i] = i * 257;
19   msg ("init: cksum=%lu", cksum (buf, sizeof buf));
20     
21   /* Shuffle repeatedly. */
22   for (i = 0; i < 10; i++)
23     {
24       shuffle (buf, sizeof buf, 1);
25       msg ("shuffle %zu: cksum=%lu", i, cksum (buf, sizeof buf));
26     }
27 }