Commit 23ecc317 authored by Dennis Jenkins's avatar Dennis Jenkins

clang++ warning reduction (mostly missing 'override').

parent 08de5060
......@@ -85,7 +85,7 @@ class MyHandler : public Http::Handler {
void onRequest(
const Http::Request& req,
Http::ResponseWriter response) {
Http::ResponseWriter response) override {
if (req.resource() == "/ping") {
if (req.method() == Http::Method::Get) {
......@@ -149,7 +149,9 @@ class MyHandler : public Http::Handler {
}
void onTimeout(const Http::Request& req, Http::ResponseWriter response) {
void onTimeout(
const Http::Request& req,
Http::ResponseWriter response) override {
UNUSED(req);
response
.send(Http::Code::Request_Timeout, "Timeout")
......
......@@ -6,23 +6,23 @@
using namespace Pistache;
using namespace Pistache::Http;
void addCookies(const char* str, std::function<void (const CookieJar&)> testFunc) {
void addCookies(const char* str,
std::function<void (const CookieJar&)> testFunc) {
CookieJar jar;
jar.addFromRaw(str, strlen(str));
testFunc(jar);
}
TEST(cookie_test_2, cookiejar_test_2) {
addCookies("key=value1; key=value2; key2=; key2=foo=bar", [](const CookieJar& jar) {
addCookies("key=value1; key=value2; key2=; key2=foo=bar",
[](const CookieJar& jar) {
int count = 0;
for (const auto& c: jar) {
count++;
}
for (const auto &c: jar) {
static_cast<void>(c); // 'c' is unused
count++;
}
ASSERT_EQ(count,4); // number of cookies must be 4 in this case
});
}
......@@ -11,7 +11,7 @@ using namespace Pistache;
struct HelloHandler : public Http::Handler {
HTTP_PROTOTYPE(HelloHandler)
void onRequest(const Http::Request& /*request*/, Http::ResponseWriter writer)
void onRequest(const Http::Request& /*request*/, Http::ResponseWriter writer) override
{
writer.send(Http::Code::Ok, "Hello, World!");
}
......@@ -142,4 +142,4 @@ TEST(http_client_test, multiple_clients_with_one_request) {
client3.shutdown();
ASSERT_TRUE(response_counter == CLIENT_SIZE);
}
\ No newline at end of file
}
......@@ -15,7 +15,7 @@ struct HelloHandlerWithDelay : public Http::Handler {
explicit HelloHandlerWithDelay(int delay = 0) : delay_(delay)
{ }
void onRequest(const Http::Request& /*request*/, Http::ResponseWriter writer)
void onRequest(const Http::Request& /*request*/, Http::ResponseWriter writer) override
{
std::this_thread::sleep_for(std::chrono::seconds(delay_));
writer.send(Http::Code::Ok, "Hello, World!");
......@@ -32,7 +32,7 @@ struct SlowHandlerOnSpecialPage : public Http::Handler {
explicit SlowHandlerOnSpecialPage(int delay = 0) : delay_(delay)
{ }
void onRequest(const Http::Request& request, Http::ResponseWriter writer)
void onRequest(const Http::Request& request, Http::ResponseWriter writer) override
{
if (request.resource() == SPECIAL_PAGE)
{
......
......@@ -124,7 +124,7 @@ TEST(payload, manual_construction) {
void onRequest(
const Http::Request& req,
Http::ResponseWriter response)
Http::ResponseWriter response) override
{
UNUSED(req);
response.send(Http::Code::Ok, "All good");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment