MCPcopy Create free account
hub / github.com/apache/impala / RandomUnpackTest

Function RandomUnpackTest

be/src/util/bit-packing-test.cc:171–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170template <typename UINT_T>
171void RandomUnpackTest() {
172 const std::vector<UINT_T> in = GenerateRandomInput<UINT_T>(NUM_IN_VALUES,
173 std::numeric_limits<UINT_T>::min(), std::numeric_limits<UINT_T>::max());
174
175 const std::vector<int> lengths = GetLengths();
176
177 constexpr int MAX_BITWIDTH = BitPacking::MAX_BITWIDTH;
178 const int max_bit_width = std::min<int>(MAX_BITWIDTH, sizeof(UINT_T) * CHAR_BIT);
179 for (int bit_width = 0; bit_width <= max_bit_width; ++bit_width) {
180 for (const int length : lengths) {
181 // Test that unpacking to/from aligned and unaligned memory works.
182 for (const bool aligned : {true, false}) {
183 PackUnpack<UINT_T>(in.data(), length, bit_width, aligned);
184 }
185 }
186 }
187}
188
189TEST(BitPackingTest, RandomUnpack8) {
190 RandomUnpackTest<uint8_t>();

Callers

nothing calls this directly

Calls 4

minFunction · 0.85
maxFunction · 0.85
GetLengthsFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected