diff --git a/include/etl/private/bitset_new.h b/include/etl/private/bitset_new.h index ef1152cd..841836a6 100644 --- a/include/etl/private/bitset_new.h +++ b/include/etl/private/bitset_new.h @@ -554,18 +554,18 @@ namespace etl //************************************************************************* /// Flip all of the bits. //************************************************************************* - static ETL_CONSTEXPR14 void flip_all(pointer pbuffer, size_t /*number_of_elements*/) ETL_NOEXCEPT + static ETL_CONSTEXPR14 void flip_all(pointer pbuffer, size_t /*number_of_elements*/, element_type top_mask) ETL_NOEXCEPT { - *pbuffer = ~*pbuffer; + *pbuffer = (~*pbuffer) & top_mask; } //************************************************************************* /// Flip some of the bits. //************************************************************************* - static ETL_CONSTEXPR14 void flip_bits(pointer pbuffer, element_type mask = etl::integral_limits::max) ETL_NOEXCEPT - { - *pbuffer ^= mask; - } + // static ETL_CONSTEXPR14 void flip_bits(pointer pbuffer, element_type mask = etl::integral_limits::max) ETL_NOEXCEPT + //{ + // *pbuffer ^= mask; + //} //************************************************************************* /// Flip the bit at the position. @@ -1253,9 +1253,9 @@ namespace etl //************************************************************************* /// Flip all of the bits. //************************************************************************* - static ETL_CONSTEXPR14 void flip_all(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT + static ETL_CONSTEXPR14 void flip_all(pointer pbuffer, size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT { - operator_not(pbuffer, number_of_elements); + operator_not(pbuffer, number_of_elements, top_mask); } //************************************************************************* @@ -1398,13 +1398,16 @@ namespace etl //************************************************************************* /// operator not //************************************************************************* - static ETL_CONSTEXPR14 void operator_not(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT + static ETL_CONSTEXPR14 void operator_not(pointer pbuffer, size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT { while (number_of_elements-- != 0) { *pbuffer = ~*pbuffer; ++pbuffer; } + + --pbuffer; // Step back to the last element. + *pbuffer &= top_mask; // Clear unused bits. } //************************************************************************* @@ -2248,7 +2251,7 @@ namespace etl //************************************************************************* ETL_CONSTEXPR14 bitset& flip() ETL_NOEXCEPT { - implementation::flip_all(buffer, Number_Of_Elements); + implementation::flip_all(buffer, Number_Of_Elements, Top_Mask); return *this; } @@ -2389,7 +2392,7 @@ namespace etl { etl::bitset temp(*this); - implementation::flip_all(temp.buffer, Number_Of_Elements); + implementation::flip_all(temp.buffer, Number_Of_Elements, Top_Mask); return temp; } @@ -3245,7 +3248,7 @@ namespace etl //************************************************************************* ETL_CONSTEXPR14 bitset_ext& flip() ETL_NOEXCEPT { - implementation::flip_all(pbuffer, Number_Of_Elements); + implementation::flip_all(pbuffer, Number_Of_Elements, Top_Mask); return *this; } diff --git a/test/test_bitset_legacy.cpp b/test/test_bitset_legacy.cpp index 643dfc27..90056064 100644 --- a/test/test_bitset_legacy.cpp +++ b/test/test_bitset_legacy.cpp @@ -1505,13 +1505,13 @@ namespace { etl::bitset<5U> bits; std::bitset<5U> stdbits; - etl::bitset<5U> negbits = ~bits; - std::bitset<5U> stdnegbits = ~stdbits; + etl::bitset<5U> negated_bits = ~bits; + std::bitset<5U> stdnegbits = ~stdbits; CHECK_EQUAL(stdbits.count(), bits.count()); CHECK_EQUAL(stdbits.all(), bits.all()); - CHECK_EQUAL(stdnegbits.count(), negbits.count()); - CHECK_EQUAL(stdnegbits.all(), negbits.all()); + CHECK_EQUAL(stdnegbits.count(), negated_bits.count()); + CHECK_EQUAL(stdnegbits.all(), negated_bits.all()); } //************************************************************************* diff --git a/test/test_bitset_new_default_element_type.cpp b/test/test_bitset_new_default_element_type.cpp index 9ecd1bf6..0321519b 100644 --- a/test/test_bitset_new_default_element_type.cpp +++ b/test/test_bitset_new_default_element_type.cpp @@ -310,6 +310,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -325,6 +327,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -340,6 +344,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -355,54 +361,29 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* - TEST(test_construct_from_nullptr_char_string) + TEST(test_construct_from_64_bit_char_string_where_the_bitset_size_is_60) { - const char* s = nullptr; + std::bitset<60> compare("110001001000110100010101100111001100010010001101000101011001"); + etl::bitset<60> data("110001001000110100010101100111001100010010001101000101011001"); - etl::bitset<60> data(s); + CHECK_EQUAL(compare.size(), data.size()); + CHECK_EQUAL(compare.count(), data.count()); - CHECK_EQUAL(60, data.size()); - CHECK_EQUAL(0, data.count()); + for (size_t i = 0UL; i < data.size(); ++i) + { + CHECK_EQUAL(compare.test(i), data.test(i)); + } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* - TEST(test_construct_from_nullptr_wchar_t_string) - { - const wchar_t* s = nullptr; - - etl::bitset<60> data(s); - - CHECK_EQUAL(60, data.size()); - CHECK_EQUAL(0, data.count()); - } - - //************************************************************************* - TEST(test_construct_from_nullptr_char16_t_string) - { - const char16_t* s = nullptr; - - etl::bitset<60> data(s); - - CHECK_EQUAL(60, data.size()); - CHECK_EQUAL(0, data.count()); - } - - //************************************************************************* - TEST(test_construct_from_nullptr_char32_t_string) - { - const char32_t* s = nullptr; - - etl::bitset<60> data(s); - - CHECK_EQUAL(60, data.size()); - CHECK_EQUAL(0, data.count()); - } - - //************************************************************************* - TEST(test_construct_from_excess_string) + TEST(test_construct_from_69_bit_char_string_where_the_bitset_size_is_64) { std::bitset<64> compare("110001001000110100010101100111001100010010001101000101011001111100001"); etl::bitset<64> data("110001001000110100010101100111001100010010001101000101011001111100001"); @@ -419,6 +400,56 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_nullptr_char_string) + { + const char* s = nullptr; + + etl::bitset<60> data(s); + + CHECK_EQUAL(60, data.size()); + CHECK_EQUAL(0, data.count()); + CHECK_EQUAL(0, data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_nullptr_wchar_t_string) + { + const wchar_t* s = nullptr; + + etl::bitset<60> data(s); + + CHECK_EQUAL(60, data.size()); + CHECK_EQUAL(0, data.count()); + CHECK_EQUAL(0, data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_nullptr_char16_t_string) + { + const char16_t* s = nullptr; + + etl::bitset<60> data(s); + + CHECK_EQUAL(60, data.size()); + CHECK_EQUAL(0, data.count()); + CHECK_EQUAL(0, data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_nullptr_char32_t_string) + { + const char32_t* s = nullptr; + + etl::bitset<60> data(s); + + CHECK_EQUAL(60, data.size()); + CHECK_EQUAL(0, data.count()); + CHECK_EQUAL(0, data.to_ullong()); } //************************************************************************* @@ -2710,5 +2741,42 @@ namespace CHECK_EQUAL(32, ETL_OR_STD17::size(b)); } + + //************************************************************************* + TEST(test_issue_497) + { + etl::bitset<11, uint8_t> bits; + + // Check the initial state of the bitset. + size_t count_set = bits.count(); + size_t count_size = bits.size(); + bool all_set = bits.all(); + + CHECK_EQUAL(0, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(false, all_set); + + // Copy flipped bits to a new bitset. + etl::bitset<11, uint8_t> negated_bits = ~bits; + + count_set = negated_bits.count(); + count_size = negated_bits.size(); + all_set = negated_bits.all(); + + CHECK_EQUAL(11, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(true, all_set); + + // Flip the bits in the original bitset. + bits.flip(); + + count_set = bits.count(); + count_size = bits.size(); + all_set = bits.all(); + + CHECK_EQUAL(11, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(true, all_set); + } } } // namespace diff --git a/test/test_bitset_new_explicit_single_element_type.cpp b/test/test_bitset_new_explicit_single_element_type.cpp index 3a44690b..3d32174d 100644 --- a/test/test_bitset_new_explicit_single_element_type.cpp +++ b/test/test_bitset_new_explicit_single_element_type.cpp @@ -307,6 +307,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -322,6 +324,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -337,6 +341,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -352,6 +358,47 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_64_bit_char_string_where_the_bitset_size_is_60) + { + std::bitset<60> compare("110001001000110100010101100111001100010010001101000101011001"); + etl::bitset<60> data("110001001000110100010101100111001100010010001101000101011001"); + + CHECK_EQUAL(compare.size(), data.size()); + CHECK_EQUAL(compare.count(), data.count()); + + for (size_t i = 0UL; i < data.size(); ++i) + { + CHECK_EQUAL(compare.test(i), data.test(i)); + } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_69_bit_char_string_where_the_bitset_size_is_64) + { + std::bitset<64> compare("110001001000110100010101100111001100010010001101000101011001111100001"); + etl::bitset<64, uint64_t> data("110001001000110100010101100111001100010010001101000101011001111100001"); + + CHECK_EQUAL(compare.size(), data.size()); + CHECK_EQUAL(compare.count(), data.count()); + CHECK_EQUAL(compare.none(), data.none()); + CHECK_EQUAL(compare.any(), data.any()); + CHECK_EQUAL(compare.all(), data.all()); + + CHECK_EQUAL_HEX(compare.to_ullong(), data.to_ullong()); + + for (size_t i = 0UL; i < data.size(); ++i) + { + CHECK_EQUAL(compare.test(i), data.test(i)); + } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -412,26 +459,11 @@ namespace CHECK_EQUAL(0U, data_wchar.count()); CHECK_EQUAL(0U, data_u16.count()); CHECK_EQUAL(0U, data_u32.count()); - } - //************************************************************************* - TEST(test_construct_from_excess_string) - { - std::bitset<64> compare("110001001000110100010101100111001100010010001101000101011001111100001"); - etl::bitset<64, uint64_t> data("110001001000110100010101100111001100010010001101000101011001111100001"); - - CHECK_EQUAL(compare.size(), data.size()); - CHECK_EQUAL(compare.count(), data.count()); - CHECK_EQUAL(compare.none(), data.none()); - CHECK_EQUAL(compare.any(), data.any()); - CHECK_EQUAL(compare.all(), data.all()); - - CHECK_EQUAL_HEX(compare.to_ullong(), data.to_ullong()); - - for (size_t i = 0UL; i < data.size(); ++i) - { - CHECK_EQUAL(compare.test(i), data.test(i)); - } + CHECK_EQUAL(0U, data_char.to_ullong()); + CHECK_EQUAL(0U, data_wchar.to_ullong()); + CHECK_EQUAL(0U, data_u16.to_ullong()); + CHECK_EQUAL(0U, data_u32.to_ullong()); } //************************************************************************* @@ -2840,5 +2872,42 @@ namespace CHECK_EQUAL(32, ETL_OR_STD17::size(b)); } + + //************************************************************************* + TEST(test_issue_497) + { + etl::bitset<5, uint8_t> bits; + + // Check the initial state of the bitset. + size_t count_set = bits.count(); + size_t count_size = bits.size(); + bool all_set = bits.all(); + + CHECK_EQUAL(0, count_set); + CHECK_EQUAL(5, count_size); + CHECK_EQUAL(false, all_set); + + // Copy flipped bits to a new bitset. + etl::bitset<5, uint8_t> negated_bits = ~bits; + + count_set = negated_bits.count(); + count_size = negated_bits.size(); + all_set = negated_bits.all(); + + CHECK_EQUAL(5, count_set); + CHECK_EQUAL(5, count_size); + CHECK_EQUAL(true, all_set); + + // Flip the bits in the original bitset. + bits.flip(); + + count_set = bits.count(); + count_size = bits.size(); + all_set = bits.all(); + + CHECK_EQUAL(5, count_set); + CHECK_EQUAL(5, count_size); + CHECK_EQUAL(true, all_set); + } } } // namespace diff --git a/test/test_bitset_new_ext_default_element_type.cpp b/test/test_bitset_new_ext_default_element_type.cpp index d506b8f3..dfa5c5aa 100644 --- a/test/test_bitset_new_ext_default_element_type.cpp +++ b/test/test_bitset_new_ext_default_element_type.cpp @@ -251,6 +251,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -267,6 +269,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -283,6 +287,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -299,6 +305,49 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_64_bit_char_string_where_the_bitset_size_is_60) + { + etl::bitset_ext<64>::buffer_type buffer; + std::bitset<60> compare("110001001000110100010101100111001100010010001101000101011001"); + etl::bitset_ext<60> data("110001001000110100010101100111001100010010001101000101011001", buffer); + + CHECK_EQUAL(compare.size(), data.size()); + CHECK_EQUAL(compare.count(), data.count()); + + for (size_t i = 0UL; i < data.size(); ++i) + { + CHECK_EQUAL(compare.test(i), data.test(i)); + } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_69_bit_char_string_where_the_bitset_size_is_64) + { + etl::bitset_ext<64>::buffer_type buffer; + std::bitset<64> compare("110001001000110100010101100111001100010010001101000101011001111100001"); + etl::bitset_ext<64> data("110001001000110100010101100111001100010010001101000101011001111100001", buffer); + + CHECK_EQUAL(compare.size(), data.size()); + CHECK_EQUAL(compare.count(), data.count()); + CHECK_EQUAL(compare.none(), data.none()); + CHECK_EQUAL(compare.any(), data.any()); + CHECK_EQUAL(compare.all(), data.all()); + + CHECK_EQUAL_HEX(compare.to_ullong(), data.to_ullong()); + + for (size_t i = 0UL; i < data.size(); ++i) + { + CHECK_EQUAL(compare.test(i), data.test(i)); + } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -349,27 +398,6 @@ namespace CHECK_EQUAL(0, data.count()); } - //************************************************************************* - TEST(test_construct_from_excess_string) - { - etl::bitset_ext<64>::buffer_type buffer; - std::bitset<64> compare("110001001000110100010101100111001100010010001101000101011001111100001"); - etl::bitset_ext<64> data("110001001000110100010101100111001100010010001101000101011001111100001", buffer); - - CHECK_EQUAL(compare.size(), data.size()); - CHECK_EQUAL(compare.count(), data.count()); - CHECK_EQUAL(compare.none(), data.none()); - CHECK_EQUAL(compare.any(), data.any()); - CHECK_EQUAL(compare.all(), data.all()); - - CHECK_EQUAL_HEX(compare.to_ullong(), data.to_ullong()); - - for (size_t i = 0UL; i < data.size(); ++i) - { - CHECK_EQUAL(compare.test(i), data.test(i)); - } - } - //************************************************************************* TEST(test_set) { @@ -2460,5 +2488,42 @@ namespace CHECK_EQUAL(32, ETL_OR_STD17::size(b)); } + + //************************************************************************* + TEST(test_issue_497) + { + etl::bitset_ext<11>::buffer_type buffer1; + etl::bitset_ext<11> bits(buffer1); + + // Check the initial state of the bitset. + size_t count_set = bits.count(); + size_t count_size = bits.size(); + bool all_set = bits.all(); + + CHECK_EQUAL(0, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(false, all_set); + + // Copy flipped bits to a new bitset. + etl::bitset_ext<11>::buffer_type buffer2; + etl::bitset_ext<11> negated_bits(bits.flip(), buffer2); + + count_set = negated_bits.count(); + count_size = negated_bits.size(); + all_set = negated_bits.all(); + + CHECK_EQUAL(11, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(true, all_set); + + // Test the flipped the bits in the original bitset. + count_set = bits.count(); + count_size = bits.size(); + all_set = bits.all(); + + CHECK_EQUAL(11, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(true, all_set); + } } } // namespace diff --git a/test/test_bitset_new_ext_explicit_single_element_type.cpp b/test/test_bitset_new_ext_explicit_single_element_type.cpp index e51ccb7e..889ff78c 100644 --- a/test/test_bitset_new_ext_explicit_single_element_type.cpp +++ b/test/test_bitset_new_ext_explicit_single_element_type.cpp @@ -279,6 +279,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -295,6 +297,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -311,6 +315,8 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -327,6 +333,49 @@ namespace { CHECK_EQUAL(compare.test(i), data.test(i)); } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_64_bit_char_string_where_the_bitset_size_is_60) + { + etl::bitset_ext<64, uint64_t>::buffer_type buffer; + std::bitset<60> compare("110001001000110100010101100111001100010010001101000101011001"); + etl::bitset_ext<60, uint64_t> data("110001001000110100010101100111001100010010001101000101011001", buffer); + + CHECK_EQUAL(compare.size(), data.size()); + CHECK_EQUAL(compare.count(), data.count()); + + for (size_t i = 0UL; i < data.size(); ++i) + { + CHECK_EQUAL(compare.test(i), data.test(i)); + } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); + } + + //************************************************************************* + TEST(test_construct_from_69_bit_char_string_where_the_bitset_size_is_64) + { + etl::bitset_ext<64, uint64_t>::buffer_type buffer; + std::bitset<64> compare("110001001000110100010101100111001100010010001101000101011001111100001"); + etl::bitset_ext<64, uint64_t> data("110001001000110100010101100111001100010010001101000101011001111100001", buffer); + + CHECK_EQUAL(compare.size(), data.size()); + CHECK_EQUAL(compare.count(), data.count()); + CHECK_EQUAL(compare.none(), data.none()); + CHECK_EQUAL(compare.any(), data.any()); + CHECK_EQUAL(compare.all(), data.all()); + + CHECK_EQUAL_HEX(compare.to_ullong(), data.to_ullong()); + + for (size_t i = 0UL; i < data.size(); ++i) + { + CHECK_EQUAL(compare.test(i), data.test(i)); + } + + CHECK_EQUAL(compare.to_ullong(), data.to_ullong()); } //************************************************************************* @@ -377,27 +426,6 @@ namespace CHECK_EQUAL(0, data.count()); } - //************************************************************************* - TEST(test_construct_from_excess_string) - { - etl::bitset_ext<64, uint64_t>::buffer_type buffer; - std::bitset<64> compare("110001001000110100010101100111001100010010001101000101011001111100001"); - etl::bitset_ext<64, uint64_t> data("110001001000110100010101100111001100010010001101000101011001111100001", buffer); - - CHECK_EQUAL(compare.size(), data.size()); - CHECK_EQUAL(compare.count(), data.count()); - CHECK_EQUAL(compare.none(), data.none()); - CHECK_EQUAL(compare.any(), data.any()); - CHECK_EQUAL(compare.all(), data.all()); - - CHECK_EQUAL_HEX(compare.to_ullong(), data.to_ullong()); - - for (size_t i = 0UL; i < data.size(); ++i) - { - CHECK_EQUAL(compare.test(i), data.test(i)); - } - } - //************************************************************************* TEST(test_set) { @@ -2629,4 +2657,41 @@ namespace CHECK_EQUAL(32, ETL_OR_STD17::size(b)); } } + + //************************************************************************* + TEST(test_issue_497) + { + etl::bitset_ext<11, uint8_t>::buffer_type buffer1; + etl::bitset_ext<11, uint8_t> bits(buffer1); + + // Check the initial state of the bitset. + size_t count_set = bits.count(); + size_t count_size = bits.size(); + bool all_set = bits.all(); + + CHECK_EQUAL(0, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(false, all_set); + + // Copy flipped bits to a new bitset. + etl::bitset_ext<11, uint8_t>::buffer_type buffer2; + etl::bitset_ext<11, uint8_t> negated_bits(bits.flip(), buffer2); + + count_set = negated_bits.count(); + count_size = negated_bits.size(); + all_set = negated_bits.all(); + + CHECK_EQUAL(11, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(true, all_set); + + // Test the flipped the bits in the original bitset. + count_set = bits.count(); + count_size = bits.size(); + all_set = bits.all(); + + CHECK_EQUAL(11, count_set); + CHECK_EQUAL(11, count_size); + CHECK_EQUAL(true, all_set); + } } // namespace