Skip to content

Commit

Permalink
fix --test=PerlinNoise --extra overflow
Browse files Browse the repository at this point in the history
Thanks to @gzm55, Fixes GH #198
  • Loading branch information
rurban committed May 16, 2021
1 parent 6eb697f commit d428f2f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions KeysetTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ void PerlinNoiseTest (int Xbits, int Ybits,

printf("Testing %i coordinates (L%i) : \n", xMax * yMax, inputLen);

for(int x = 0; x < xMax; x++) {
for(uint64_t x = 0; x < xMax; x++) {
memcpy(key, &x, inputLen); // Note : only works with Little Endian
for (int y=0; y < yMax; y++) {
for (size_t y=0; y < yMax; y++) {
hashtype h;
Hash_Seed_init (hash, y);
hash(key, inputLen, y, &h);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ SMhasher
| [MeowHash32low](doc/MeowHash32low.txt) | 17374.64 | 85.48 | 258.53 (2) |1764 | Sparse, machine-specific (x64 AES-NI) |
| -------------------------------------- | | | | | |
| [tifuhash_64](doc/tifuhash_64.txt) | 35.60 | 1679.52 |1212.75 (15)| 276 | Cyclic low32 |
| [floppsyhash](doc/floppsyhash.txt) | 35.72 | 1868.92 |1411.07 (7) | 623 | |
| [floppsyhash](doc/floppsyhash.txt) | 35.72 | 1868.92 |1411.07 (7) | 623 | |
| [chaskey](doc/chaskey.txt) | 753.23 | 153.42 | 288.26 (2) |1609 | PerlinNoise |
| [SipHash](doc/SipHash.txt) | 980.88 | 127.77 | 246.19 (4) |1071 | |
| [HalfSipHash](doc/HalfSipHash.txt) | 755.78 | 114.47 | 243.72 (4) | 700 | zeroes |
Expand Down
1 change: 0 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,6 @@ void test ( hashfunc<hashtype> hash, HashInfo* info )
if (g_testExtra) {
result &= PerlinNoise<hashtype>( hash, 4, testCollision, testDistribution, g_drawDiagram );
result &= PerlinNoise<hashtype>( hash, 8, testCollision, testDistribution, g_drawDiagram );
result &= PerlinNoise<hashtype>( hash,16, testCollision, testDistribution, g_drawDiagram );
}

if(!result) printf("*********FAIL*********\n");
Expand Down

0 comments on commit d428f2f

Please sign in to comment.