MCPcopy Create free account
hub / github.com/apache/arrow / TestLEB128Decode

Function TestLEB128Decode

cpp/src/arrow/util/bit_util_test.cc:820–829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

818/// Utility function to test LEB128 decoding with known byte array and expected result
819template <typename Int>
820void TestLEB128Decode(const std::vector<uint8_t>& data, Int expected_value,
821 int32_t expected_bytes_read) {
822 Int result = 0;
823 auto bytes_read = bit_util::ParseLeadingLEB128(
824 data.data(), static_cast<int32_t>(data.size()), &result);
825 EXPECT_EQ(bytes_read, expected_bytes_read);
826 if (expected_bytes_read > 0) {
827 EXPECT_EQ(result, expected_value);
828 }
829}
830
831/// Test decoding from known LEB128 byte sequences with edge case parameters.
832/// \see LEB128.KnownSuccessfulValues for other known values tested.

Callers 1

TESTFunction · 0.85

Calls 3

ParseLeadingLEB128Function · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected