Commit fac0be10 authored by Renjie's avatar Renjie Committed by Commit Bot

Remove unused function and its corresponded test. No behavior change.

Merge internal change: 206330851

Bug: 788385
Change-Id: I0a0823638aa9692024751a80e6470bb11ddfeb3c
Reviewed-on: https://chromium-review.googlesource.com/1153387Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Commit-Queue: Renjie Tang <renjietang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578870}
parent c8df356d
...@@ -48,17 +48,6 @@ bool QuicDataWriter::WriteUInt64(uint64_t value) { ...@@ -48,17 +48,6 @@ bool QuicDataWriter::WriteUInt64(uint64_t value) {
return WriteBytes(&value, sizeof(value)); return WriteBytes(&value, sizeof(value));
} }
bool QuicDataWriter::WriteUInt8AtOffset(uint8_t value, size_t offset) {
if (offset > length_) {
return false;
}
size_t old_length = length_;
length_ = offset;
bool result = WriteBytes(&value, sizeof(value));
length_ = old_length;
return result;
}
bool QuicDataWriter::WriteBytesToUInt64(size_t num_bytes, uint64_t value) { bool QuicDataWriter::WriteBytesToUInt64(size_t num_bytes, uint64_t value) {
if (num_bytes > sizeof(value)) { if (num_bytes > sizeof(value)) {
return false; return false;
......
...@@ -76,10 +76,6 @@ class QUIC_EXPORT_PRIVATE QuicDataWriter { ...@@ -76,10 +76,6 @@ class QUIC_EXPORT_PRIVATE QuicDataWriter {
// is too large to encode. // is too large to encode.
static int GetVarInt62Len(uint64_t value); static int GetVarInt62Len(uint64_t value);
// Writes |value| to the position |offset| from the start of the data.
// |offset| must be less than the current length of the writer.
bool WriteUInt8AtOffset(uint8_t value, size_t offset);
// Writes least significant |num_bytes| of a 64-bit unsigned integer in the // Writes least significant |num_bytes| of a 64-bit unsigned integer in the
// correct byte order. // correct byte order.
bool WriteBytesToUInt64(size_t num_bytes, uint64_t value); bool WriteBytesToUInt64(size_t num_bytes, uint64_t value);
......
...@@ -567,23 +567,6 @@ TEST_P(QuicDataWriterTest, WriteBytes) { ...@@ -567,23 +567,6 @@ TEST_P(QuicDataWriterTest, WriteBytes) {
} }
} }
TEST_P(QuicDataWriterTest, WriteUInt8AtOffset) {
char bytes[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'};
char buf[QUIC_ARRAYSIZE(bytes)];
for (unsigned int i = 0; i < QUIC_ARRAYSIZE(bytes); ++i) {
QuicDataWriter writer(QUIC_ARRAYSIZE(buf), buf, GetParam().endianness);
EXPECT_TRUE(writer.WriteBytes(bytes, QUIC_ARRAYSIZE(bytes)));
EXPECT_TRUE(writer.WriteUInt8AtOffset('I', i));
for (unsigned int j = 0; j < QUIC_ARRAYSIZE(bytes); ++j) {
if (j == i) {
EXPECT_EQ('I', buf[j]);
} else {
EXPECT_EQ(bytes[j], buf[j]);
}
}
}
}
const int kVarIntBufferLength = 1024; const int kVarIntBufferLength = 1024;
// Encodes and then decodes a specified value, checks that the // Encodes and then decodes a specified value, checks that the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment