19#define BOOST_TEST_NO_MAIN
20#include <boost/test/unit_test.hpp>
28 BOOST_CHECK_EQUAL( bs.size(), 10 );
29 BOOST_CHECK_EQUAL( bs.count(), 0 );
32 BOOST_CHECK_EQUAL( bs.size(), 20 );
33 BOOST_CHECK_EQUAL( bs.count(), 0 );
40 BOOST_CHECK( bs.test( 2 ) );
41 BOOST_CHECK_EQUAL( bs.count(), 1 );
44 BOOST_CHECK( !bs.test( 2 ) );
45 BOOST_CHECK_EQUAL( bs.count(), 0 );
51 BOOST_CHECK_EQUAL( bs.size(), 10 );
52 BOOST_CHECK_EQUAL( bs.count(), 0 );
55 BOOST_CHECK_EQUAL( bs.size(), 11 );
56 BOOST_CHECK_EQUAL( bs.count(), 1 );
59 BOOST_CHECK_EQUAL( bs.size(), 11 );
60 BOOST_CHECK_EQUAL( bs.count(), 0 );
63 BOOST_CHECK_EQUAL( bs.size(), 21 );
64 BOOST_CHECK_EQUAL( bs.count(), 0 );
74 BOOST_CHECK_EQUAL( *it, 2 );
76 BOOST_CHECK_EQUAL( *it, 4 );
81 std::vector<size_t> reverse_set_bits;
84 reverse_set_bits.push_back( *rit );
87 BOOST_CHECK_EQUAL( reverse_set_bits.size(), 2 );
88 BOOST_CHECK_EQUAL( reverse_set_bits[0], 4 );
89 BOOST_CHECK_EQUAL( reverse_set_bits[1], 2 );
105 BOOST_CHECK( set1 == set2 );
106 BOOST_CHECK( !( set1 == set3 ) );
107 BOOST_CHECK( !( set2 == set3 ) );
122 BOOST_CHECK( set3 < set1 );
123 BOOST_CHECK( set2 < set3 );
124 BOOST_CHECK( !( set1 < set3 ) );
125 BOOST_CHECK( !( set1 < set2 ) );
146 BOOST_CHECK_EQUAL( set1.
compare( set2 ), 0 );
147 BOOST_CHECK_EQUAL( set1.
compare( set3 ), 1 );
148 BOOST_CHECK_EQUAL( set3.
compare( set1 ), -1 );
149 BOOST_CHECK_EQUAL( set3.
compare( set4 ), -1 );
150 BOOST_CHECK_EQUAL( set4.
compare( set3 ), 1 );
165 BOOST_CHECK_EQUAL( bs1.test( 1 ),
false );
166 BOOST_CHECK_EQUAL( bs1.test( 2 ),
false );
167 BOOST_CHECK_EQUAL( bs1.test( 3 ),
true );
180 BOOST_CHECK_EQUAL( bs1.test( 1 ),
true );
181 BOOST_CHECK_EQUAL( bs1.test( 2 ),
true );
182 BOOST_CHECK_EQUAL( bs1.test( 3 ),
true );
196 BOOST_CHECK_EQUAL( bs1.test( 1 ),
true );
197 BOOST_CHECK_EQUAL( bs1.test( 2 ),
true );
198 BOOST_CHECK_EQUAL( bs1.test( 3 ),
false );
209 BOOST_CHECK_EQUAL( bs2.test( 0 ),
true );
210 BOOST_CHECK_EQUAL( bs2.test( 1 ),
false );
211 BOOST_CHECK_EQUAL( bs2.test( 2 ),
true );
212 BOOST_CHECK_EQUAL( bs2.test( 3 ),
false );
226 BOOST_CHECK_EQUAL( result.test( 1 ),
false );
227 BOOST_CHECK_EQUAL( result.test( 2 ),
false );
228 BOOST_CHECK_EQUAL( result.test( 3 ),
true );
241 BOOST_CHECK_EQUAL( result.test( 1 ),
true );
242 BOOST_CHECK_EQUAL( result.test( 2 ),
true );
243 BOOST_CHECK_EQUAL( result.test( 3 ),
true );
257 BOOST_CHECK_EQUAL( result.test( 1 ),
true );
258 BOOST_CHECK_EQUAL( result.test( 2 ),
true );
259 BOOST_CHECK_EQUAL( result.test( 3 ),
false );
269 std::hash<BASE_SET> hashFn;
270 size_t hash = hashFn( bs1 );
276 BOOST_CHECK_EQUAL( hash, hashFn( bs2 ) );
279 BOOST_CHECK_NE( hash, hashFn( bs2 ) );
set_bits_reverse_iterator set_bits_rbegin() const
set_bits_iterator set_bits_end() const
BASE_SET & reset(size_t pos)
set_bits_reverse_iterator set_bits_rend() const
int compare(const BASE_SET &other) const
BASE_SET & set(size_t pos)
set_bits_iterator set_bits_begin() const
BOOST_AUTO_TEST_CASE(ConstructionAndSize)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()