From f64e01a20c76b0c7b6d0b26ebeb9187820456986 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 29 Apr 2018 03:15:57 +0200 Subject: [PATCH] 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 --- tests/15library.tests | 1 + tests/library/hash-generator-test.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/15library.tests b/tests/15library.tests index e289c71ec..3aa51767f 100644 --- a/tests/15library.tests +++ b/tests/15library.tests @@ -150,6 +150,7 @@ out: ID-Fork.0.. out: ID-special out: sizeof\( idi::EntryID \) .+ = out: sizeof\( idi::BareEntryID \) .+ = +out: sizeof\( \w+[^\)]* \) .+ = return: 0 END diff --git a/tests/library/hash-generator-test.cpp b/tests/library/hash-generator-test.cpp index 4bcbebed1..b6ee9f1b2 100644 --- a/tests/library/hash-generator-test.cpp +++ b/tests/library/hash-generator-test.cpp @@ -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 "<