MCPcopy Create free account
hub / github.com/apache/orc / decodeAndVerifyBoolean

Function decodeAndVerifyBoolean

c++/test/TestByteRLEEncoder.cc:80–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 void decodeAndVerifyBoolean(const MemoryOutputStream& memStream, char* data, uint64_t numValues,
81 char* notNull) {
82 auto inStream =
83 std::make_unique<SeekableArrayInputStream>(memStream.getData(), memStream.getLength());
84
85 std::unique_ptr<ByteRleDecoder> decoder =
86 createBooleanRleDecoder(std::move(inStream), getDefaultReaderMetrics());
87
88 char* decodedData = new char[numValues];
89 decoder->next(decodedData, numValues, notNull);
90
91 for (uint64_t i = 0; i < numValues; ++i) {
92 if (!notNull || notNull[i]) {
93 bool expect = data[i] != 0;
94 bool actual = decodedData[i] != 0;
95 EXPECT_EQ(expect, actual);
96 }
97 }
98
99 delete[] decodedData;
100 }
101
102 TEST(ByteRleEncoder, random_chars) {
103 MemoryOutputStream memStream(DEFAULT_MEM_STREAM_SIZE);

Callers 1

TESTFunction · 0.85

Calls 5

createBooleanRleDecoderFunction · 0.85
getDefaultReaderMetricsFunction · 0.85
getLengthMethod · 0.65
nextMethod · 0.65
getDataMethod · 0.45

Tested by

no test coverage detected