+#endif
+}
+
+static void testmul128(unsigned int a0, unsigned int a1, unsigned int a2, unsigned int a3, unsigned int b0, unsigned int b1, unsigned int b2, unsigned int b3, unsigned int x0, unsigned int x1, unsigned int x2, unsigned int x3)
+{
+ unsigned int a[4];
+ unsigned int b[4];
+ unsigned int expected[4];
+ unsigned int result[4];
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+ b[0] = b0;
+ b[1] = b1;
+ b[2] = b2;
+ b[3] = b3;
+ expected[0] = x0;
+ expected[1] = x1;
+ expected[2] = x2;
+ expected[3] = x3;
+ mul128(a, b, result);
+ if (result[0] != expected[0]
+ || result[1] != expected[1]
+ || result[2] != expected[2]
+ || result[3] != expected[3])
+ Con_Printf("testmul128(\na = %08x %08x %08x %08x,\nb = %08x %08x %08x %08x,\nx = %08x %08x %08x %08x) instead computed\nc = %08x %08x %08x %08x\n", a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3], expected[0], expected[1], expected[2], expected[3], result[0], result[1], result[2], result[3]);
+}
+
+void Math_RandomSeed_UnitTests(void)
+{
+ testmul128(
+ 0x00000000, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000001);
+ testmul128(
+ 0x00000000, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x00000000, 0x00000001, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000001, 0x00000000);
+ testmul128(
+ 0x00000000, 0x00000000, 0x00000001, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x00000000, 0x00000001, 0x00000000);
+ testmul128(
+ 0x00000000, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000001, 0x00000001, 0x00000001, 0x00000001,
+ 0x00000001, 0x00000001, 0x00000001, 0x00000001);
+ testmul128(
+ 0x00000000, 0x00000000, 0x00000000, 0x00000002,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffffe);
+ testmul128(
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000002,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffffe);
+ testmul128(
+ 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
+ 0x00000000, 0x00000000, 0x00000002, 0x00000000,
+ 0x00000001, 0xffffffff, 0xfffffffe, 0x00000000);
+ testmul128(
+ 0x00000000, 0x00000000, 0x00000002, 0x00000000,
+ 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
+ 0x00000001, 0xffffffff, 0xfffffffe, 0x00000000);