| 255 | } |
| 256 | |
| 257 | void TestBadMethod(bool use_html) { |
| 258 | std::string expect_type = (use_html ? "text/html" : "text/plain"); |
| 259 | brpc::BadMethodService service; |
| 260 | brpc::BadMethodResponse res; |
| 261 | { |
| 262 | ClosureChecker done; |
| 263 | brpc::Controller cntl; |
| 264 | SetUpController(&cntl, use_html); |
| 265 | brpc::BadMethodRequest req; |
| 266 | req.set_service_name( |
| 267 | brpc::PProfService::descriptor()->full_name()); |
| 268 | service.no_method(&cntl, &req, &res, &done); |
| 269 | EXPECT_EQ(brpc::ENOMETHOD, cntl.ErrorCode()); |
| 270 | EXPECT_EQ(expect_type, cntl.http_response().content_type()); |
| 271 | CheckErrorText(cntl, "growth"); |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | void TestFlags(bool use_html) { |
| 276 | std::string expect_type = (use_html ? "text/html" : "text/plain"); |
nothing calls this directly
no test coverage detected