| 132 | } |
| 133 | |
| 134 | void CheckFieldInContent(const brpc::Controller& cntl, |
| 135 | const char* name, int32_t expect) { |
| 136 | const std::string& content = cntl.response_attachment().to_string(); |
| 137 | std::size_t pos = content.find(name); |
| 138 | ASSERT_TRUE(pos != std::string::npos); |
| 139 | |
| 140 | int32_t val = 0; |
| 141 | ASSERT_EQ(1, sscanf(content.c_str() + pos + strlen(name), "%d", &val)); |
| 142 | ASSERT_EQ(expect, val) << "name=" << name; |
| 143 | } |
| 144 | |
| 145 | void CheckAnnotation(const brpc::Controller& cntl, int64_t expect) { |
| 146 | const std::string& content = cntl.response_attachment().to_string(); |
no test coverage detected