| 44 | } |
| 45 | |
| 46 | void TestZLong(uint8_t* buf, int64_t buf_len, int64_t expected_val, |
| 47 | int expected_encoded_len) { |
| 48 | uint8_t* new_buf = buf; |
| 49 | ReadWriteUtil::ZLongResult r = ReadWriteUtil::ReadZLong(&new_buf, buf + buf_len); |
| 50 | EXPECT_TRUE(r.ok); |
| 51 | EXPECT_EQ(r.val, expected_val); |
| 52 | EXPECT_EQ(new_buf - buf, expected_encoded_len); |
| 53 | } |
| 54 | |
| 55 | void TestZLong(int64_t value) { |
| 56 | uint8_t buf[ReadWriteUtil::MAX_ZLONG_LEN]; |