-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diff Test, expected collisions do not affect the testing result #199
Comments
Yes, the calculation of We don't check against the float calc of expected, we check only against 3 or more collisions as described in the comment. A much simpler test. |
ok, but the last group should be counted, in the block including line 68. |
This is reported bug #199: rurban/smhasher#199 To see this bug in action, apply the following patch (without this fix!): @@ -158,7 +158,7 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions ) reps,testcount,expected); Hash_Seed_init (hash, g_seed); - for(int i = 0; i < reps; i++) + for(int i = 0; i < 0; i++) { if(i % (reps/10) == 0) printf("."); @@ -173,6 +173,10 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions ) bool result = true; + r.rand_p(&k1,sizeof(keytype)); + diffs.push_back(k1); + diffs.push_back(k1); + result &= ProcessDifferentials(diffs,reps,dumpCollisions); return result;
This is reported bug #199: #199 To see this bug in action, apply the following patch (without this fix!): @@ -158,7 +158,7 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions ) reps,testcount,expected); Hash_Seed_init (hash, g_seed); - for(int i = 0; i < reps; i++) + for(int i = 0; i < 0; i++) { if(i % (reps/10) == 0) printf("."); @@ -173,6 +173,10 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions ) bool result = true; + r.rand_p(&k1,sizeof(keytype)); + diffs.push_back(k1); + diffs.push_back(k1); + result &= ProcessDifferentials(diffs,reps,dumpCollisions); return result;
This is reported bug rurban#199: rurban#199 To see this bug in action, apply the following patch (without this fix!): @@ -158,7 +158,7 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions ) reps,testcount,expected); Hash_Seed_init (hash, g_seed); - for(int i = 0; i < reps; i++) + for(int i = 0; i < 0; i++) { if(i % (reps/10) == 0) printf("."); @@ -173,6 +173,10 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions ) bool result = true; + r.rand_p(&k1,sizeof(keytype)); + diffs.push_back(k1); + diffs.push_back(k1); + result &= ProcessDifferentials(diffs,reps,dumpCollisions); return result;
In
Diff
Test, we have an excepted collision count:smhasher/DifferentialTest.h
Line 141 in d428f2f
But this variable seems do not affect the testing result:
smhasher/DifferentialTest.h
Line 44 in d428f2f
and the last group collisions are also skipped for unsetting the
result
.smhasher/DifferentialTest.h
Line 68 in d428f2f
The text was updated successfully, but these errors were encountered: