| 104 | |
| 105 | template <class TBitMapImpl> |
| 106 | void TestAndImpl() { |
| 107 | TBitMapImpl bitmap1; |
| 108 | TBitMapImpl bitmap2; |
| 109 | |
| 110 | size_t initBits1[] = {10, 20, 50, 100}; |
| 111 | size_t initBits2[] = {10, 11, 22, 50}; |
| 112 | |
| 113 | INIT_BITMAP(bitmap1, initBits1); |
| 114 | INIT_BITMAP(bitmap2, initBits2); |
| 115 | |
| 116 | bitmap1.And(bitmap2); |
| 117 | |
| 118 | UNIT_ASSERT_EQUAL(bitmap1.Count(), 2); |
| 119 | UNIT_ASSERT_EQUAL(bitmap2.Count(), 4); |
| 120 | |
| 121 | size_t resBits[] = {10, 50}; |
| 122 | |
| 123 | CHECK_BITMAP(bitmap1, resBits); |
| 124 | CHECK_BITMAP(bitmap2, initBits2); |
| 125 | } |
| 126 | |
| 127 | Y_UNIT_TEST(TestAndFixed) { |
| 128 | TestAndImpl<TBitMap<101>>(); |