MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_F

Function TEST_F

bolt/common/encode/tests/CodingTest.cpp:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27};
28
29TEST_F(VarintTest, EncodeDecodeUInt64) {
30 uint64_t values[] = {
31 0, 1, 127, 128, 255, 256, 1024, 10000, 123456789, UINT64_MAX};
32 for (uint64_t val : values) {
33 char buffer[Varint::kMaxSize64] = {0};
34 char* dest = buffer;
35 Varint::encode(val, &dest);
36
37 int expected_size = Varint::size(val);
38 EXPECT_EQ(dest - buffer, expected_size);
39
40 const char* src = buffer;
41 uint64_t decoded = Varint::decode(&src, dest - buffer);
42 EXPECT_EQ(val, decoded);
43 }
44}
45
46TEST_F(VarintTest, EncodeDecodeInt32) {
47 int32_t values[] = {

Callers

nothing calls this directly

Calls 4

encodeFunction · 0.85
sizeFunction · 0.85
UInt128Class · 0.85
decodeFunction · 0.50

Tested by

no test coverage detected