MCPcopy Create free account
hub / github.com/apache/brpc / TEST_F

Function TEST_F

test/brpc_grpc_protocol_unittest.cpp:128–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126};
127
128TEST_F(GrpcTest, percent_encode) {
129 std::string out;
130 std::string s1("abcdefg !@#$^&*()/");
131 std::string s1_out("abcdefg%20%21%40%23%24%5e%26%2a%28%29%2f");
132 brpc::PercentEncode(s1, &out);
133 EXPECT_TRUE(out == s1_out) << s1_out << " vs " << out;
134
135 char s2_buf[] = "\0\0%\33\35 brpc";
136 std::string s2(s2_buf, sizeof(s2_buf) - 1);
137 std::string s2_expected_out("%00%00%25%1b%1d%20brpc");
138 brpc::PercentEncode(s2, &out);
139 EXPECT_TRUE(out == s2_expected_out) << s2_expected_out << " vs " << out;
140}
141
142TEST_F(GrpcTest, percent_decode) {
143 std::string out;

Callers

nothing calls this directly

Calls 13

PercentEncodeFunction · 0.85
PercentDecodeFunction · 0.85
string_printfFunction · 0.85
MethodMethod · 0.80
ErrorCodeMethod · 0.80
ends_withMethod · 0.80
ErrorTextMethod · 0.80
MethodTimeOutMethod · 0.80
set_timeout_msMethod · 0.80
SetHeaderMethod · 0.80
FailedMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected