Go to the documentation of this file.
26 #include <gtest/gtest.h>
28 #include "absl/strings/str_cat.h"
41 void AssertIndex(
const HPackTable* tbl,
uint32_t idx,
const char*
key,
43 const auto*
md = tbl->Lookup(
idx);
49 TEST(HpackParserTableTest, StaticTable) {
53 AssertIndex(&tbl, 1,
":authority",
"");
54 AssertIndex(&tbl, 2,
":method",
"GET");
55 AssertIndex(&tbl, 3,
":method",
"POST");
56 AssertIndex(&tbl, 4,
":path",
"/");
57 AssertIndex(&tbl, 5,
":path",
"/index.html");
58 AssertIndex(&tbl, 6,
":scheme",
"http");
59 AssertIndex(&tbl, 7,
":scheme",
"https");
60 AssertIndex(&tbl, 8,
":status",
"200");
61 AssertIndex(&tbl, 9,
":status",
"204");
62 AssertIndex(&tbl, 10,
":status",
"206");
63 AssertIndex(&tbl, 11,
":status",
"304");
64 AssertIndex(&tbl, 12,
":status",
"400");
65 AssertIndex(&tbl, 13,
":status",
"404");
66 AssertIndex(&tbl, 14,
":status",
"500");
67 AssertIndex(&tbl, 15,
"accept-charset",
"");
68 AssertIndex(&tbl, 16,
"accept-encoding",
"gzip, deflate");
69 AssertIndex(&tbl, 17,
"accept-language",
"");
70 AssertIndex(&tbl, 18,
"accept-ranges",
"");
71 AssertIndex(&tbl, 19,
"accept",
"");
72 AssertIndex(&tbl, 20,
"access-control-allow-origin",
"");
73 AssertIndex(&tbl, 21,
"age",
"");
74 AssertIndex(&tbl, 22,
"allow",
"");
75 AssertIndex(&tbl, 23,
"authorization",
"");
76 AssertIndex(&tbl, 24,
"cache-control",
"");
77 AssertIndex(&tbl, 25,
"content-disposition",
"");
78 AssertIndex(&tbl, 26,
"content-encoding",
"");
79 AssertIndex(&tbl, 27,
"content-language",
"");
80 AssertIndex(&tbl, 28,
"content-length",
"");
81 AssertIndex(&tbl, 29,
"content-location",
"");
82 AssertIndex(&tbl, 30,
"content-range",
"");
83 AssertIndex(&tbl, 31,
"content-type",
"");
84 AssertIndex(&tbl, 32,
"cookie",
"");
85 AssertIndex(&tbl, 33,
"date",
"");
86 AssertIndex(&tbl, 34,
"etag",
"");
87 AssertIndex(&tbl, 35,
"expect",
"");
88 AssertIndex(&tbl, 36,
"expires",
"");
89 AssertIndex(&tbl, 37,
"from",
"");
90 AssertIndex(&tbl, 38,
"host",
"");
91 AssertIndex(&tbl, 39,
"if-match",
"");
92 AssertIndex(&tbl, 40,
"if-modified-since",
"");
93 AssertIndex(&tbl, 41,
"if-none-match",
"");
94 AssertIndex(&tbl, 42,
"if-range",
"");
95 AssertIndex(&tbl, 43,
"if-unmodified-since",
"");
96 AssertIndex(&tbl, 44,
"last-modified",
"");
97 AssertIndex(&tbl, 45,
"link",
"");
98 AssertIndex(&tbl, 46,
"location",
"");
99 AssertIndex(&tbl, 47,
"max-forwards",
"");
100 AssertIndex(&tbl, 48,
"proxy-authenticate",
"");
101 AssertIndex(&tbl, 49,
"proxy-authorization",
"");
102 AssertIndex(&tbl, 50,
"range",
"");
103 AssertIndex(&tbl, 51,
"referer",
"");
104 AssertIndex(&tbl, 52,
"refresh",
"");
105 AssertIndex(&tbl, 53,
"retry-after",
"");
106 AssertIndex(&tbl, 54,
"server",
"");
107 AssertIndex(&tbl, 55,
"set-cookie",
"");
108 AssertIndex(&tbl, 56,
"strict-transport-security",
"");
109 AssertIndex(&tbl, 57,
"transfer-encoding",
"");
110 AssertIndex(&tbl, 58,
"user-agent",
"");
111 AssertIndex(&tbl, 59,
"vary",
"");
112 AssertIndex(&tbl, 60,
"via",
"");
113 AssertIndex(&tbl, 61,
"www-authenticate",
"");
116 TEST(HpackParserTableTest, ManyAdditions) {
122 for (
i = 0;
i < 100000;
i++) {
144 int main(
int argc,
char** argv) {
#define ASSERT_NE(val1, val2)
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
ParsedMetadata< grpc_metadata_batch > Memento
static Slice FromCopiedString(const char *s)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
grpc_error_handle Add(Memento md) GRPC_MUST_USE_RESULT
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
static constexpr uint32_t kLastStaticEntry
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
grpc_core::ExecCtx exec_ctx
int main(int argc, char **argv)
GRPCAPI void grpc_init(void)
GRPCAPI void grpc_shutdown(void)
#define ASSERT_EQ(val1, val2)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:01