Fix randomizer

Relying on the system randomizer for unit tests leads to cases where we
don't get deterministic results, which causes inconsistent results.
These random results don't need to be secure, so reimplement as a simple
linear feedback shift register[1].  This makes our unit tests now
produce the same output every time we call generate.

Note, this change showed a weakness in our testing, where timestamps
relied on different rules for ir->cper versus cper->ir.  hour 24 should
be allowed.

[1] https://en.wikipedia.org/wiki/Linear-feedback_shift_register

Change-Id: I0756b086c8ea5fb934e450f5d33e3ae0036868b3
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/generator/sections/gen-section-memory.c b/generator/sections/gen-section-memory.c
index a45f0ce..866fe0c 100644
--- a/generator/sections/gen-section-memory.c
+++ b/generator/sections/gen-section-memory.c
@@ -30,7 +30,7 @@
 	*(bytes + 73) &= ~0x1C; //Extended bits 2-4
 
 	//Fix values that could be above range.
-	*(bytes + 72) = rand() % 16; //Memory error type
+	*(bytes + 72) = cper_rand() % 16; //Memory error type
 
 	//Fix error status.
 	create_valid_error_section(bytes + 8);
@@ -61,8 +61,8 @@
 	*(bytes + 63) = 0; //Reserved byte 63
 
 	//Fix values that could be above range.
-	*(bytes + 61) = rand() % 16; //Memory error type
-	*(bytes + 62) = rand() % 2;  //Status
+	*(bytes + 61) = cper_rand() % 16; //Memory error type
+	*(bytes + 62) = cper_rand() % 2;  //Status
 
 	//Fix error status.
 	create_valid_error_section(bytes + 8);