From b3c7994a1deff7f367f6155f58983c64e73067f4 Mon Sep 17 00:00:00 2001 From: Etienne Renault Date: Wed, 10 Jun 2020 14:46:35 +0200 Subject: [PATCH] bricks: rework tests On some architectures this test fails due to several reasons: - missing headers - use of valueAt instead of count in ConCS. Indeed, valueAt acts similarly to count but avoids some validity check that are required when the hashmap is growing. This patch also: - removes inaccurate comments from bricks.test. - test more features for hashset. * spot/bricks/brick-hashset, tests/core/bricks.cc, tests/core/bricks.test: Here. --- spot/bricks/brick-hashset | 2 +- tests/core/bricks.cc | 12 +++++++++--- tests/core/bricks.test | 4 ---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/spot/bricks/brick-hashset b/spot/bricks/brick-hashset index d4b9ccbe8..1c97c9618 100644 --- a/spot/bricks/brick-hashset +++ b/spot/bricks/brick-hashset @@ -965,7 +965,7 @@ struct Sequential unsigned count = 0; for ( unsigned i = 0; i != set.capacity(); ++i ) - if ( set.valueAt( i ) ) + if ( set.count( i ) ) ++count; ASSERT_EQ( count, 1u ); diff --git a/tests/core/bricks.cc b/tests/core/bricks.cc index 919a37d7d..ec386be4b 100644 --- a/tests/core/bricks.cc +++ b/tests/core/bricks.cc @@ -18,8 +18,14 @@ // along with this program. If not, see . #include "config.h" -#include + +#include +#include #include +#include +#include +#include + struct both { @@ -74,9 +80,9 @@ static void test_brick_hashmap() std::cout << " [HM -- Sequential] Testing basic\n"; e.basic(); std::cout << " [HM -- Sequential] Testing stress\n"; - e.basic(); + e.stress(); std::cout << " [HM -- Sequential] Testing set\n"; - e.basic(); + e.set(); }, t1, t2, t3, t4); brick::t_hashset::Parallel< brick::t_hashset::ConCS > t5; diff --git a/tests/core/bricks.test b/tests/core/bricks.test index 0c1d5dc1c..b98c7e856 100644 --- a/tests/core/bricks.test +++ b/tests/core/bricks.test @@ -18,10 +18,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Do some quick translations to make sure the neverclaims produced by -# spot actually look correct! We do that by parsing them via ltlcross. -# ltl2neverclaim-lbtt.test does the same with LBTT if it is installed. - . ./defs set -e