Webserver Add 404 error support and test.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -20,7 +20,7 @@ steps:
|
|||||||
image: registry.nadal-fr.com/buildroot_dev
|
image: registry.nadal-fr.com/buildroot_dev
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p domo-iot/build
|
- mkdir -p domo-iot/build
|
||||||
- cd domo-iot/build && cmake .. -DDOMO_BUILD_TEST=ON
|
- cd domo-iot/build && cmake .. -DDOMO_BUILD_TEST=ON -DCMAKE_BUILD_TYPE=Debug
|
||||||
- make
|
- make
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
|
|||||||
@@ -849,7 +849,7 @@ void rest_request_cb(struct evhttp_request *req, void *arg)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO 404
|
evhttp_send_error(req, HTTP_NOTFOUND, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -635,5 +635,8 @@ TEST("Rest - Test Web server part.\t")
|
|||||||
ASSERT_EQUAL_INT(ret, 0);
|
ASSERT_EQUAL_INT(ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = exec_request(kput_method, "http://localhost:" kserver_port "/not_found.html", 404, "", "<html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1></body></html>", false);
|
||||||
|
ASSERT_EQUAL_INT(ret, 0);
|
||||||
|
|
||||||
restd_server_free(rest_server);
|
restd_server_free(rest_server);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user