/
d.vision
/
division_engine_cpp
Обзор
Документация
Войти
/
d.vision
/
division_engine_cpp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
third_party/flecs-3.2.11/test/addons/src/Http.c
70 строк
1 KB
Den163
Added flecs and glm to the repo
31 май 2024, 23:08
31 май 2024, 23:08
5d252b3
Код
Авторство
О чём код?
#include <addons.h> static bool OnRequest( const ecs_http_request_t* request, ecs_http_reply_t *reply, void *ctx) { return true; } void Http_teardown(void) { ecs_set_os_api_impl(); ecs_http_server_t *srv = ecs_http_server_init(&(ecs_http_server_desc_t){ .port = 27750, .callback = OnRequest }); test_assert(srv != NULL); ecs_http_server_fini(srv); } void Http_teardown_started(void) { ecs_set_os_api_impl(); ecs_http_server_t *srv = ecs_http_server_init(&(ecs_http_server_desc_t){ .port = 27751, .callback = OnRequest }); test_assert(srv != NULL); test_int(ecs_http_server_start(srv), 0); ecs_http_server_fini(srv); } void Http_teardown_stopped(void) { ecs_set_os_api_impl(); ecs_http_server_t *srv = ecs_http_server_init(&(ecs_http_server_desc_t){ .port = 27752, .callback = OnRequest }); test_assert(srv != NULL); test_int(ecs_http_server_start(srv), 0); ecs_http_server_stop(srv); ecs_http_server_fini(srv); } void Http_stop_start(void) { ecs_set_os_api_impl(); ecs_http_server_t *srv = ecs_http_server_init(&(ecs_http_server_desc_t){ .port = 27753, .callback = OnRequest }); test_assert(srv != NULL); test_int(ecs_http_server_start(srv), 0); ecs_http_server_stop(srv); test_int(ecs_http_server_start(srv), 0); ecs_http_server_fini(srv); }