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.
This commit is contained in:
Etienne Renault 2020-06-10 14:46:35 +02:00
parent f748281719
commit b3c7994a1d
3 changed files with 10 additions and 8 deletions

View file

@ -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 );

View file

@ -18,8 +18,14 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#include <spot/bricks/brick-hashset>
#include <spot/bricks/brick-assert>
#include <spot/bricks/brick-bitlevel>
#include <spot/bricks/brick-hash>
#include <spot/bricks/brick-hashset>
#include <spot/bricks/brick-shmem>
#include <spot/bricks/brick-types>
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;

View file

@ -18,10 +18,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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