OpenEXR/IlmImfTest/testHuf.cpp: Do the compressVerify() on deterministic data sets.
Updated to run compressVerify() on the fill4() and fill5() data sets which are
deterministic across platforms.
Added a comment to explain how these DEK hash are determined aprior for code
defines.
@@ -176,6 +176,15 @@ compressUncompressSubset(const unsigned short raw[], int n)
// This check is intended to test for regressions
// in the hufCompress() result or difference results across OSes.
//
+// The platform agnostic DEK hash of the huf compressed data for
+// the set of numbers generated by fill4() and fill5().
+// This DEK hash is determined from an aprior initial run of this
+// test noting its value from the assert message compressVerify().
+//
+#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2956869585U
+#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 3414126535U
+#define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 169791374U
+
void
compressVerify (const unsigned short raw[],
int n,
@@ -221,7 +230,6 @@ testHuf (const std::string&)
Array <unsigned short> raw (N);
fill1 (raw, N, 1, rand48); // test various symbol distributions
- compressVerify(raw, N, 3762495704U);
compressUncompress (raw, N);
compressUncompressSubset (raw, N);
fill1 (raw, N, 10, rand48);
@@ -261,9 +269,11 @@ testHuf (const std::string&)
compressUncompressSubset (raw, N);
fill4 (raw, USHRT_MAX + 1);
+ compressVerify(raw, USHRT_MAX + 1, HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE);
compressUncompress (raw, USHRT_MAX + 1);
compressUncompressSubset (raw, USHRT_MAX + 1);
fill4 (raw, N);
+ compressVerify(raw, N, HUF_COMPRESS_DEK_HASH_FOR_FILL4_N);
compressUncompress (raw, N);
compressUncompressSubset (raw, N);
@@ -277,6 +287,7 @@ testHuf (const std::string&)
compressUncompress (raw, 3);
fill5 (raw, N); // test run-length coding of code table
+ compressVerify(raw, N, HUF_COMPRESS_DEK_HASH_FOR_FILL5_N);
compressUncompress (raw, N);
compressUncompressSubset (raw, N);
