@@ -181,9 +181,9 @@ compressUncompressSubset(const unsigned short raw[], int n)
181
181
// This DEK hash is determined from an aprior initial run of this
182
182
// test noting its value from the assert message compressVerify().
183
183
//
184
- #define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2956869585U
185
- #define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 3414126535U
186
- #define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 169791374U
184
+ #define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2013380646U
185
+ #define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 213880353U
186
+ #define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 2492982090U
187
187
188
188
void
189
189
compressVerify (const unsigned short raw[],
@@ -200,7 +200,7 @@ compressVerify (const unsigned short raw[],
200
200
// under the topic of sorting and search chapter 6.4.
201
201
//
202
202
unsigned int compressedHash = nCompressed;
203
- const char * cptr = compressed;
203
+ const unsigned char * cptr = reinterpret_cast < const unsigned char *>( ( const char *) compressed) ;
204
204
for (int i = 0 ; i < nCompressed; ++i)
205
205
{
206
206
compressedHash =
@@ -210,6 +210,25 @@ compressVerify (const unsigned short raw[],
210
210
cout << " verifying compressed checksum hash = "
211
211
<< compressedHash << std::endl;
212
212
213
+ if (compressedHash != dekHash)
214
+ {
215
+ cout << " hash verification failed. Got " << compressedHash << " expected " << dekHash << std::endl;
216
+ const unsigned char * cptr = reinterpret_cast <const unsigned char *>( (const char *) compressed);
217
+ for (int i = 0 ; i < nCompressed ; ++i )
218
+ {
219
+ cout << std::hex << (0xFF & (int ) (*cptr++));
220
+ if ( (i & 0xF ) ==0 )
221
+ {
222
+ cout << ' \n ' ;
223
+ }
224
+ else
225
+ {
226
+ cout << ' ' ;
227
+ }
228
+ }
229
+ cout << " \n " ;
230
+ }
231
+
213
232
assert (compressedHash == dekHash);
214
233
}
215
234
0 commit comments