| 56 | } |
| 57 | |
| 58 | TEST_F(TestBitMapAccumulator, TestIntersectBitMaps) { |
| 59 | const int length = 128; |
| 60 | const int nrecords = length * 8; |
| 61 | uint8_t src_bitmaps[4][length]; |
| 62 | uint8_t dst_bitmap[length]; |
| 63 | uint8_t expected_bitmap[length]; |
| 64 | |
| 65 | for (int i = 0; i < 4; i++) { |
| 66 | FillBitMap(src_bitmaps[i], i, length); |
| 67 | } |
| 68 | |
| 69 | for (int i = 0; i < 4; i++) { |
| 70 | std::vector<const uint8_t*> src_bitmap_ptrs; |
| 71 | std::vector<int64_t> src_bitmap_offsets(i, 0); |
| 72 | for (int j = 0; j < i; ++j) { |
| 73 | src_bitmap_ptrs.push_back(src_bitmaps[j]); |
| 74 | } |
| 75 | |
| 76 | BitMapAccumulator::IntersectBitMaps(dst_bitmap, src_bitmap_ptrs, src_bitmap_offsets, |
| 77 | nrecords); |
| 78 | ByteWiseIntersectBitMaps(expected_bitmap, src_bitmap_ptrs, src_bitmap_offsets, |
| 79 | nrecords); |
| 80 | EXPECT_EQ(memcmp(dst_bitmap, expected_bitmap, length), 0); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | TEST_F(TestBitMapAccumulator, TestIntersectBitMapsWithOffset) { |
| 85 | const int length = 128; |
nothing calls this directly
no test coverage detected