Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / filesys / base / seq-random.inc
diff --git a/src/tests/filesys/base/seq-random.inc b/src/tests/filesys/base/seq-random.inc
new file mode 100644 (file)
index 0000000..a4da4c5
--- /dev/null
@@ -0,0 +1,22 @@
+/* -*- c -*- */
+
+#include <random.h>
+#include "tests/filesys/seq-test.h"
+#include "tests/main.h"
+
+static char buf[TEST_SIZE];
+
+static size_t
+return_random (void) 
+{
+  return random_ulong () % 1031 + 1;
+}
+
+void
+test_main (void) 
+{
+  random_init (-1);
+  seq_test ("nibble",
+            buf, sizeof buf, sizeof buf,
+            return_random, NULL);
+}