GCC-7: minor adjustments to make the testsuite PASS again

The boost::hash documentation does not mention a significant change in that area,
yet the frequent collisions on identifiers with number suffix do not occur anymore
in Boost 1.65
This commit is contained in:
Fischlurch 2018-04-29 03:15:57 +02:00
parent f99637285a
commit f64e01a20c
2 changed files with 6 additions and 1 deletions

View file

@ -150,6 +150,7 @@ out: ID<Fork>-Fork.0..
out: ID<Fork>-special
out: sizeof\( idi::EntryID<Fork> \) .+ =
out: sizeof\( idi::BareEntryID \) .+ =
out: sizeof\( \w+[^\)]* \) .+ =
return: 0
END

View file

@ -78,6 +78,7 @@ namespace test{
*
* This problem is especially dangerous when storing objects keyed
* by a string-id, which is generated from running numbers.
* @remark as of 2018 the boost::hash function does not show this weakness anymore
*/
void
demonstrate_boost_hash_weakness ()
@ -106,7 +107,10 @@ namespace test{
}
hashValues[hashVal] = candidate;
}
CHECK (0 < collisions, "boost::hash for strings is expected to produce collisions");
if (0 < collisions)
cout << "boost::hash for strings produced "<<collisions<<" collisions. This is a known problem."<<endl;
else
cout << "SURPRISE. No collisions with the boost::hash function." <<endl;
}