"unexpected value #8 from RNG",
uint16_t(0x0000), value
);
+ random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #9 from RNG",
uint16_t(0x0000), value
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #11 from RNG",
- uint16_t(0x0000), value
+ uint16_t(0x2E70), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #12 from RNG",
- uint16_t(0x2E70), value
+ uint16_t(0x0000), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #15 from RNG",
- uint16_t(0x0000), value
+ uint16_t(0x1011), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #16 from RNG",
- uint16_t(0x1011), value
+ uint16_t(0x0000), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #18 from RNG",
- uint16_t(0x0000), value
+ uint16_t(0xB000), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #19 from RNG",
- uint16_t(0xB000), value
+ uint16_t(0x0B0B), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #20 from RNG",
- uint16_t(0x0B0B), value
+ uint16_t(0x0000), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #22 from RNG",
- uint16_t(0x0000), value
+ uint16_t(0x1500), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #23 from RNG",
- uint16_t(0x1500), value
+ uint16_t(0x0454), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #24 from RNG",
- uint16_t(0x0454), value
+ uint16_t(0x0000), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #26 from RNG",
- uint16_t(0x0000), value
+ uint16_t(0xC970), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #27 from RNG",
- uint16_t(0xC970), value
+ uint16_t(0x02E5), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #28 from RNG",
- uint16_t(0x02E5), value
+ uint16_t(0x0000), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #30 from RNG",
- uint16_t(0x0000), value
+ uint16_t(0x0101), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #31 from RNG",
- uint16_t(0x0101), value
+ uint16_t(0x0100), value
);
random(value);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"unexpected value #32 from RNG",
- uint16_t(0x0100), value
+ uint16_t(0x0000), value
+ );
+
+ GaloisLFSR random1(1);
+ uint16_t value1;
+ for (int i = 0; i < 32; ++i) {
+ random1(value1);
+ }
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "RNG with seeds 0 and 1 differ",
+ value, value1
);
}