Replace QUICHE_ARRAYSIZE with ABSL_ARRAYSIZE.
PiperOrigin-RevId: 338053242
Change-Id: I465f25aab04362c58f3de543b45277107638f558
diff --git a/quic/core/qpack/qpack_header_table_test.cc b/quic/core/qpack/qpack_header_table_test.cc
index c096855..b06786e 100644
--- a/quic/core/qpack/qpack_header_table_test.cc
+++ b/quic/core/qpack/qpack_header_table_test.cc
@@ -6,10 +6,10 @@
#include <utility>
+#include "absl/base/macros.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_static_table.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h"
using ::testing::Mock;
diff --git a/quic/core/qpack/qpack_required_insert_count_test.cc b/quic/core/qpack/qpack_required_insert_count_test.cc
index fce7de9..fca16c0 100644
--- a/quic/core/qpack/qpack_required_insert_count_test.cc
+++ b/quic/core/qpack/qpack_required_insert_count_test.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -50,7 +50,7 @@
{600, 100, 500}};
TEST(QpackRequiredInsertCountTest, QpackDecodeRequiredInsertCount) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kTestData); ++i) {
const uint64_t required_insert_count = kTestData[i].required_insert_count;
const uint64_t max_entries = kTestData[i].max_entries;
const uint64_t total_number_of_inserts =
@@ -109,7 +109,7 @@
{601, 100, 500}};
TEST(QpackRequiredInsertCountTest, DecodeRequiredInsertCountError) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kInvalidTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kInvalidTestData); ++i) {
uint64_t decoded_required_insert_count = 0;
EXPECT_FALSE(QpackDecodeRequiredInsertCount(
kInvalidTestData[i].encoded_required_insert_count,
diff --git a/quic/core/qpack/qpack_send_stream.cc b/quic/core/qpack/qpack_send_stream.cc
index e70fbe5..d6919d7 100644
--- a/quic/core/qpack/qpack_send_stream.cc
+++ b/quic/core/qpack/qpack_send_stream.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h"
+#include "absl/base/macros.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
QpackSendStream::QpackSendStream(QuicStreamId id,
@@ -36,7 +36,7 @@
void QpackSendStream::MaybeSendStreamType() {
if (!stream_type_sent_) {
char type[sizeof(http3_stream_type_)];
- QuicDataWriter writer(QUICHE_ARRAYSIZE(type), type);
+ QuicDataWriter writer(ABSL_ARRAYSIZE(type), type);
writer.WriteVarInt62(http3_stream_type_);
WriteOrBufferData(absl::string_view(writer.data(), writer.length()), false,
nullptr);
diff --git a/quic/core/qpack/qpack_static_table.cc b/quic/core/qpack/qpack_static_table.cc
index 17138be..e88abe0 100644
--- a/quic/core/qpack/qpack_static_table.cc
+++ b/quic/core/qpack/qpack_static_table.cc
@@ -4,15 +4,15 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_static_table.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
// The "constructor" for a QpackStaticEntry that computes the lengths at
// compile time.
#define STATIC_ENTRY(name, value) \
- { name, QUICHE_ARRAYSIZE(name) - 1, value, QUICHE_ARRAYSIZE(value) - 1 }
+ { name, ABSL_ARRAYSIZE(name) - 1, value, ABSL_ARRAYSIZE(value) - 1 }
const std::vector<QpackStaticEntry>& QpackStaticTableVector() {
static const auto* kQpackStaticTable = new std::vector<QpackStaticEntry>{
diff --git a/quic/core/qpack/qpack_static_table_test.cc b/quic/core/qpack/qpack_static_table_test.cc
index ce5bc99..a771cf3 100644
--- a/quic/core/qpack/qpack_static_table_test.cc
+++ b/quic/core/qpack/qpack_static_table_test.cc
@@ -6,9 +6,9 @@
#include <set>
+#include "absl/base/macros.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
diff --git a/quic/core/qpack/value_splitting_header_list_test.cc b/quic/core/qpack/value_splitting_header_list_test.cc
index ac754e1..2d0d6b4 100644
--- a/quic/core/qpack/value_splitting_header_list_test.cc
+++ b/quic/core/qpack/value_splitting_header_list_test.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h"
+#include "absl/base/macros.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -113,7 +113,7 @@
{"cookie", "; foobar; ", {"", "foobar", ""}},
};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kTestData); ++i) {
spdy::SpdyHeaderBlock block;
block[kTestData[i].name] = kTestData[i].value;
diff --git a/spdy/core/hpack/hpack_constants.cc b/spdy/core/hpack/hpack_constants.cc
index 71ac139..8d60d5e 100644
--- a/spdy/core/hpack/hpack_constants.cc
+++ b/spdy/core/hpack/hpack_constants.cc
@@ -8,7 +8,7 @@
#include <memory>
#include <vector>
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
@@ -290,7 +290,7 @@
// The "constructor" for a HpackStaticEntry that computes the lengths at
// compile time.
#define STATIC_ENTRY(name, value) \
- { name, QUICHE_ARRAYSIZE(name) - 1, value, QUICHE_ARRAYSIZE(value) - 1 }
+ { name, ABSL_ARRAYSIZE(name) - 1, value, ABSL_ARRAYSIZE(value) - 1 }
const std::vector<HpackStaticEntry>& HpackStaticTableVector() {
static const auto* kHpackStaticTable = new std::vector<HpackStaticEntry>{
diff --git a/spdy/core/hpack/hpack_decoder_adapter_test.cc b/spdy/core/hpack/hpack_decoder_adapter_test.cc
index c1ed5d6..b1591af 100644
--- a/spdy/core/hpack/hpack_decoder_adapter_test.cc
+++ b/spdy/core/hpack/hpack_decoder_adapter_test.cc
@@ -13,11 +13,11 @@
#include <utility>
#include <vector>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h"
@@ -614,7 +614,7 @@
// name.
const char input[] = "\x04\x0c/sample/path\x00\x06:path2\x0e/sample/path/2";
const SpdyHeaderBlock& header_set = DecodeBlockExpectingSuccess(
- absl::string_view(input, QUICHE_ARRAYSIZE(input) - 1));
+ absl::string_view(input, ABSL_ARRAYSIZE(input) - 1));
SpdyHeaderBlock expected_header_set;
expected_header_set[":path"] = "/sample/path";
@@ -627,7 +627,7 @@
TEST_P(HpackDecoderAdapterTest, LiteralHeaderIncrementalIndexing) {
const char input[] = "\x44\x0c/sample/path\x40\x06:path2\x0e/sample/path/2";
const SpdyHeaderBlock& header_set = DecodeBlockExpectingSuccess(
- absl::string_view(input, QUICHE_ARRAYSIZE(input) - 1));
+ absl::string_view(input, ABSL_ARRAYSIZE(input) - 1));
SpdyHeaderBlock expected_header_set;
expected_header_set[":path"] = "/sample/path";
diff --git a/spdy/core/hpack/hpack_huffman_table_test.cc b/spdy/core/hpack/hpack_huffman_table_test.cc
index b820f5e..6c3e288 100644
--- a/spdy/core/hpack/hpack_huffman_table_test.cc
+++ b/spdy/core/hpack/hpack_huffman_table_test.cc
@@ -7,8 +7,8 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h"
@@ -69,7 +69,7 @@
{0b11000000000000000000000000000000, 3, 6},
{0b11100000000000000000000000000000, 8, 7}};
HpackHuffmanTable table;
- EXPECT_TRUE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_TRUE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
}
{
// But using 2 bits with one symbol overflows the code.
@@ -83,7 +83,7 @@
{0b11100000000000000000000000000000, 3, 6},
{0b00000000000000000000000000000000, 8, 7}}; // Overflow.
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(7, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -93,7 +93,7 @@
{0b11000000000000000000000000000000, 3, 2},
{0b11100000000000000000000000000000, 8, 3}};
HpackHuffmanTable table;
- EXPECT_TRUE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_TRUE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
}
{
// But repeating a length overflows the code.
@@ -103,7 +103,7 @@
{0b11000000000000000000000000000000, 2, 2},
{0b00000000000000000000000000000000, 8, 3}}; // Overflow.
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(3, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -114,7 +114,7 @@
{0b11000000000000000000000000000000, 3, 1}, // Repeat.
{0b11100000000000000000000000000000, 8, 3}};
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(2, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -124,7 +124,7 @@
{0b10100000000000000000000000000000, 4, 2},
{0b10110000000000000000000000000000, 8, 3}};
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(0, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -135,7 +135,7 @@
{0b11000000000000000000000000000000, 2, 2}, // Code not canonical.
{0b10000000000000000000000000000000, 8, 3}};
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(2, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -145,7 +145,7 @@
{0b11000000000000000000000000000000, 3, 2},
{0b11100000000000000000000000000000, 7, 3}};
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
}
}
@@ -159,11 +159,11 @@
{0b10001000000000000000000000000000, 5, 5}, // 6th.
{0b10011000000000000000000000000000, 8, 6}, // 8th.
{0b10010000000000000000000000000000, 5, 7}}; // 7th.
- EXPECT_TRUE(table_.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_TRUE(table_.Initialize(code, ABSL_ARRAYSIZE(code)));
- ASSERT_EQ(QUICHE_ARRAYSIZE(code), peer_.code_by_id().size());
- ASSERT_EQ(QUICHE_ARRAYSIZE(code), peer_.length_by_id().size());
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(code); ++i) {
+ ASSERT_EQ(ABSL_ARRAYSIZE(code), peer_.code_by_id().size());
+ ASSERT_EQ(ABSL_ARRAYSIZE(code), peer_.length_by_id().size());
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(code); ++i) {
EXPECT_EQ(code[i].code, peer_.code_by_id()[i]);
EXPECT_EQ(code[i].length, peer_.length_by_id()[i]);
}
@@ -171,10 +171,10 @@
EXPECT_EQ(0b10011000, peer_.pad_bits());
char input_storage[] = {2, 3, 2, 7, 4};
- absl::string_view input(input_storage, QUICHE_ARRAYSIZE(input_storage));
+ absl::string_view input(input_storage, ABSL_ARRAYSIZE(input_storage));
// By symbol: (2) 00 (3) 010 (2) 00 (7) 10010 (4) 10000 (6 as pad) 1001100.
char expect_storage[] = {0b00010001, 0b00101000, 0b01001100};
- absl::string_view expect(expect_storage, QUICHE_ARRAYSIZE(expect_storage));
+ absl::string_view expect(expect_storage, ABSL_ARRAYSIZE(expect_storage));
EXPECT_EQ(expect, EncodeString(input));
}
@@ -213,7 +213,7 @@
"custom-value",
};
// Round-trip each test example.
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); i += 2) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
const std::string& encodedFixture(test_table[i]);
const std::string& decodedFixture(test_table[i + 1]);
DecodeString(encodedFixture, &buffer);
@@ -242,7 +242,7 @@
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1",
};
// Round-trip each test example.
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); i += 2) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
const std::string& encodedFixture(test_table[i]);
const std::string& decodedFixture(test_table[i + 1]);
DecodeString(encodedFixture, &buffer);
@@ -256,7 +256,7 @@
for (size_t i = 0; i != 256; i++) {
char c = static_cast<char>(i);
char storage[3] = {c, c, c};
- absl::string_view input(storage, QUICHE_ARRAYSIZE(storage));
+ absl::string_view input(storage, ABSL_ARRAYSIZE(storage));
std::string buffer_in = EncodeString(input);
std::string buffer_out;
DecodeString(buffer_in, &buffer_out);
@@ -270,7 +270,7 @@
storage[i] = static_cast<char>(i);
storage[511 - i] = static_cast<char>(i);
}
- absl::string_view input(storage, QUICHE_ARRAYSIZE(storage));
+ absl::string_view input(storage, ABSL_ARRAYSIZE(storage));
std::string buffer_in = EncodeString(input);
std::string buffer_out;
DecodeString(buffer_in, &buffer_out);
@@ -289,12 +289,12 @@
};
for (size_t i = 0; i != 256; ++i) {
// Expand last |test_table| entry to cover all codes.
- test_table[QUICHE_ARRAYSIZE(test_table) - 1][i] = static_cast<char>(i);
+ test_table[ABSL_ARRAYSIZE(test_table) - 1][i] = static_cast<char>(i);
}
HpackOutputStream output_stream;
std::string encoding;
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); ++i) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); ++i) {
table_.EncodeString(test_table[i], &output_stream);
output_stream.TakeString(&encoding);
EXPECT_EQ(encoding.size(), table_.EncodedSize(test_table[i]));
diff --git a/spdy/core/spdy_frame_reader_test.cc b/spdy/core/spdy_frame_reader_test.cc
index df0dfcc..1e46c48 100644
--- a/spdy/core/spdy_frame_reader_test.cc
+++ b/spdy/core/spdy_frame_reader_test.cc
@@ -6,7 +6,7 @@
#include <cstdint>
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/common/quiche_endian.h"
@@ -41,7 +41,7 @@
};
SpdyFrameReader frame_reader(reinterpret_cast<const char*>(kFrameData),
- QUICHE_ARRAYSIZE(kFrameData) * sizeof(uint32_t));
+ ABSL_ARRAYSIZE(kFrameData) * sizeof(uint32_t));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint32_t uint32_val;
@@ -64,7 +64,7 @@
0x20, 0x31, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x33, // "Testing, 1, 2, 3"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
absl::string_view stringpiece_val;
@@ -87,7 +87,7 @@
0x20, 0x34, 0x2c, 0x20, 0x35, 0x2c, 0x20, 0x36, // "Testing, 4, 5, 6"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
absl::string_view stringpiece_val;
@@ -106,7 +106,7 @@
0x00, // part of a uint16_t
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint16_t uint16_val;
@@ -119,7 +119,7 @@
0x00, 0x00, 0x00, // part of a uint32_t
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint32_t uint32_val;
@@ -139,7 +139,7 @@
0x48, 0x69, // "Hi"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
absl::string_view stringpiece_val;
@@ -158,7 +158,7 @@
0x00, // part of a uint16_t
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
absl::string_view stringpiece_val;
@@ -178,7 +178,7 @@
0x48, 0x69, // "Hi"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
absl::string_view stringpiece_val;
@@ -197,7 +197,7 @@
0x00, 0x00, 0x00, // part of a uint32_t
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
absl::string_view stringpiece_val;
@@ -216,18 +216,18 @@
0x48, 0x69, // "Hi"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
char dest1[3] = {};
- EXPECT_TRUE(frame_reader.ReadBytes(&dest1, QUICHE_ARRAYSIZE(dest1)));
+ EXPECT_TRUE(frame_reader.ReadBytes(&dest1, ABSL_ARRAYSIZE(dest1)));
EXPECT_FALSE(frame_reader.IsDoneReading());
- EXPECT_EQ("foo", absl::string_view(dest1, QUICHE_ARRAYSIZE(dest1)));
+ EXPECT_EQ("foo", absl::string_view(dest1, ABSL_ARRAYSIZE(dest1)));
char dest2[2] = {};
- EXPECT_TRUE(frame_reader.ReadBytes(&dest2, QUICHE_ARRAYSIZE(dest2)));
+ EXPECT_TRUE(frame_reader.ReadBytes(&dest2, ABSL_ARRAYSIZE(dest2)));
EXPECT_TRUE(frame_reader.IsDoneReading());
- EXPECT_EQ("Hi", absl::string_view(dest2, QUICHE_ARRAYSIZE(dest2)));
+ EXPECT_EQ("Hi", absl::string_view(dest2, ABSL_ARRAYSIZE(dest2)));
}
TEST(SpdyFrameReaderTest, ReadBytesWithBufferTooSmall) {
@@ -236,11 +236,11 @@
0x01,
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- char dest[QUICHE_ARRAYSIZE(kFrameData) + 2] = {};
- EXPECT_FALSE(frame_reader.ReadBytes(&dest, QUICHE_ARRAYSIZE(kFrameData) + 1));
+ char dest[ABSL_ARRAYSIZE(kFrameData) + 2] = {};
+ EXPECT_FALSE(frame_reader.ReadBytes(&dest, ABSL_ARRAYSIZE(kFrameData) + 1));
EXPECT_STREQ("", dest);
}
diff --git a/spdy/core/spdy_framer_test.cc b/spdy/core/spdy_framer_test.cc
index 864ea7d..cd96457 100644
--- a/spdy/core/spdy_framer_test.cc
+++ b/spdy/core/spdy_framer_test.cc
@@ -13,7 +13,7 @@
#include <utility>
#include <vector>
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/array_output_buffer.h"
#include "net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h"
@@ -1315,7 +1315,7 @@
const char bytes[] = "this is a test test test test test!";
SpdyDataIR data_ir(/* stream_id = */ 1,
- absl::string_view(bytes, QUICHE_ARRAYSIZE(bytes)));
+ absl::string_view(bytes, ABSL_ARRAYSIZE(bytes)));
data_ir.set_fin(true);
SpdySerializedFrame send_frame(framer_.SerializeData(data_ir));
@@ -1335,8 +1335,7 @@
EXPECT_EQ(0, visitor.error_count_);
EXPECT_EQ(1, visitor.headers_frame_count_);
- EXPECT_EQ(QUICHE_ARRAYSIZE(bytes),
- static_cast<unsigned>(visitor.data_bytes_));
+ EXPECT_EQ(ABSL_ARRAYSIZE(bytes), static_cast<unsigned>(visitor.data_bytes_));
EXPECT_EQ(0, visitor.fin_frame_count_);
EXPECT_EQ(0, visitor.fin_flag_count_);
EXPECT_EQ(1, visitor.end_of_stream_count_);
@@ -1361,8 +1360,7 @@
0x12, 0x34, 0x56, 0x78, // Increment: 305419896
};
- CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ CompareFrame(kDescription, frame, kH2FrameData, ABSL_ARRAYSIZE(kH2FrameData));
}
TEST_P(SpdyFramerTest, CreateDataFrame) {
@@ -1383,7 +1381,7 @@
SpdyDataIR data_ir(/* stream_id = */ 1, bytes);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
SpdyDataIR data_header_ir(/* stream_id = */ 1);
data_header_ir.SetDataShallow(bytes);
@@ -1439,7 +1437,7 @@
data_ir.set_padding_len(248);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
@@ -1469,7 +1467,7 @@
data_ir.set_padding_len(8);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
@@ -1499,7 +1497,7 @@
data_ir.set_padding_len(1);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
@@ -1519,7 +1517,7 @@
SpdyDataIR data_ir(/* stream_id = */ 1, "\xff");
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1536,7 +1534,7 @@
data_ir.set_fin(true);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1550,7 +1548,7 @@
SpdyDataIR data_ir(/* stream_id = */ 1, "");
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
@@ -1572,7 +1570,7 @@
data_ir.set_fin(true);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -1593,7 +1591,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1614,7 +1612,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1635,7 +1633,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -1663,7 +1661,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1699,7 +1697,7 @@
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1719,7 +1717,7 @@
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -1752,7 +1750,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
// Tests SpdyPingIR when the ping is an ack.
ping_ir.set_is_ack(true);
@@ -1763,7 +1761,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameDataWithAck,
- QUICHE_ARRAYSIZE(kH2FrameDataWithAck));
+ ABSL_ARRAYSIZE(kH2FrameDataWithAck));
}
}
@@ -1787,7 +1785,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1810,7 +1808,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -1845,7 +1843,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1877,7 +1875,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1909,7 +1907,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1946,7 +1944,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1986,7 +1984,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kV4FrameData,
- QUICHE_ARRAYSIZE(kV4FrameData));
+ ABSL_ARRAYSIZE(kV4FrameData));
}
{
@@ -2026,7 +2024,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kV4FrameData,
- QUICHE_ARRAYSIZE(kV4FrameData));
+ ABSL_ARRAYSIZE(kV4FrameData));
}
{
@@ -2064,7 +2062,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -2087,7 +2085,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -2109,7 +2107,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -2131,7 +2129,7 @@
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -2169,7 +2167,7 @@
push_promise.SetHeader("foo", "bar");
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
{
@@ -2209,7 +2207,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
{
@@ -2269,7 +2267,7 @@
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
}
@@ -2323,7 +2321,7 @@
ASSERT_TRUE(framer.SerializeContinuation(continuation, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
// Test that if we send an unexpected CONTINUATION
@@ -2455,17 +2453,16 @@
// Partially compare the PUSH_PROMISE frame against the template.
const unsigned char* frame_data =
reinterpret_cast<const unsigned char*>(frame.data());
- CompareCharArraysWithHexError(
- kDescription, frame_data,
- QUICHE_ARRAYSIZE(kPartialPushPromiseFrameData),
- kPartialPushPromiseFrameData,
- QUICHE_ARRAYSIZE(kPartialPushPromiseFrameData));
+ CompareCharArraysWithHexError(kDescription, frame_data,
+ ABSL_ARRAYSIZE(kPartialPushPromiseFrameData),
+ kPartialPushPromiseFrameData,
+ ABSL_ARRAYSIZE(kPartialPushPromiseFrameData));
// Compare the CONTINUATION frame against the template.
frame_data += kHttp2MaxControlFrameSendSize;
CompareCharArraysWithHexError(
- kDescription, frame_data, QUICHE_ARRAYSIZE(kContinuationFrameData),
- kContinuationFrameData, QUICHE_ARRAYSIZE(kContinuationFrameData));
+ kDescription, frame_data, ABSL_ARRAYSIZE(kContinuationFrameData),
+ kContinuationFrameData, ABSL_ARRAYSIZE(kContinuationFrameData));
}
}
@@ -2492,7 +2489,7 @@
EXPECT_EQ(framer_.SerializeFrame(altsvc_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, CreatePriority) {
@@ -2514,7 +2511,7 @@
EXPECT_EQ(framer_.SerializeFrame(priority_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, CreateUnknown) {
@@ -2541,7 +2538,7 @@
EXPECT_EQ(framer_.SerializeFrame(unknown_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
// Test serialization of a SpdyUnknownIR with a defined type, a length field
@@ -2573,7 +2570,7 @@
EXPECT_EQ(framer_.SerializeFrame(unknown_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, ReadCompressedHeadersHeaderBlock) {
@@ -3609,7 +3606,7 @@
// Simulate the case where the stream id validation checks out.
visitor.on_unknown_frame_result_ = true;
- visitor.SimulateInFramer(unknown_frame, QUICHE_ARRAYSIZE(unknown_frame));
+ visitor.SimulateInFramer(unknown_frame, ABSL_ARRAYSIZE(unknown_frame));
EXPECT_EQ(0, visitor.error_count_);
// Follow it up with a valid control frame to make sure we handle
@@ -3645,7 +3642,7 @@
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
TestExtension extension;
visitor.set_extension_visitor(&extension);
- visitor.SimulateInFramer(unknown_frame, QUICHE_ARRAYSIZE(unknown_frame));
+ visitor.SimulateInFramer(unknown_frame, ABSL_ARRAYSIZE(unknown_frame));
EXPECT_EQ(0, visitor.error_count_);
EXPECT_EQ(0x7fffffffu, extension.stream_id_);
EXPECT_EQ(20u, extension.length_);
@@ -3676,7 +3673,7 @@
0xff, 0xff, 0xff, 0xff, //
};
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
- visitor.SimulateInFramer(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ visitor.SimulateInFramer(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_EQ(1, visitor.error_count_);
}
@@ -3695,7 +3692,7 @@
};
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
- visitor.SimulateInFramer(kInput, QUICHE_ARRAYSIZE(kInput));
+ visitor.SimulateInFramer(kInput, ABSL_ARRAYSIZE(kInput));
EXPECT_EQ(1, visitor.error_count_);
}
@@ -4220,7 +4217,7 @@
EXPECT_CALL(visitor, OnRstStream(1, ERROR_CODE_NO_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2RstStreamInvalid),
- QUICHE_ARRAYSIZE(kH2RstStreamInvalid));
+ ABSL_ARRAYSIZE(kH2RstStreamInvalid));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
@@ -4230,7 +4227,7 @@
EXPECT_CALL(visitor, OnRstStream(1, ERROR_CODE_INTERNAL_ERROR));
deframer_.ProcessInput(
reinterpret_cast<const char*>(kH2RstStreamNumStatusCodes),
- QUICHE_ARRAYSIZE(kH2RstStreamNumStatusCodes));
+ ABSL_ARRAYSIZE(kH2RstStreamNumStatusCodes));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
@@ -4253,7 +4250,7 @@
EXPECT_CALL(visitor, OnGoAway(1, ERROR_CODE_INTERNAL_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2FrameData),
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
@@ -4277,7 +4274,7 @@
EXPECT_CALL(visitor, OnGoAway(0x7fffffff, ERROR_CODE_NO_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2FrameData),
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
@@ -4770,7 +4767,7 @@
SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION);
const char bytes[] = "this is a very short data frame";
- SpdyDataIR data_ir(1, absl::string_view(bytes, QUICHE_ARRAYSIZE(bytes)));
+ SpdyDataIR data_ir(1, absl::string_view(bytes, ABSL_ARRAYSIZE(bytes)));
CheckFrameAndIRSize(&data_ir, &framer, &output_);
SpdyRstStreamIR rst_ir(/* stream_id = */ 1, ERROR_CODE_PROTOCOL_ERROR);