feat: implement router free function

This commit is contained in:
Jef Roosens 2024-02-24 13:25:06 +01:00
parent 9fa009ccf4
commit fbd41f7e4e
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
3 changed files with 25 additions and 5 deletions

View file

@ -4,7 +4,7 @@
void test_routing_simple() {
lnm_http_router *router;
lnm_http_router_init(&router);
TEST_CHECK(lnm_http_router_init(&router) == lnm_err_ok);
TEST_CHECK(lnm_http_router_add(NULL, router, lnm_http_method_get, "/test") == lnm_err_ok);
TEST_CHECK(lnm_http_router_add(NULL, router, lnm_http_method_get, "/test/test2") == lnm_err_ok);
@ -37,6 +37,8 @@ void test_routing_simple() {
TEST_CHECK((segment = lnm_http_route_match_get(&match, "hello")) != NULL);
TEST_CHECK(segment->start == 6);
TEST_CHECK(segment->len == 8);
lnm_http_router_free(router);
}
TEST_LIST = {