feat: complete human-vs-ESP32 gameplay and cumulative statistics

This commit is contained in:
2026-08-29 23:33:27 +03:00
parent 650ade2726
commit c8e0c9168b
14 changed files with 269 additions and 19 deletions
+5
View File
@@ -140,6 +140,11 @@ static void test_sessions_commands_and_state(void) {
assert(response.status == 200U && strstr(response.body, "\"viewer\":\"player1\"") != NULL);
response = call(&api, HTTP_API_ROUTE_STATE, HTTP_API_GET, NULL, "bad");
expect_code(&response, 401U, "UNAUTHORIZED");
response = call(&api, HTTP_API_ROUTE_STATISTICS, HTTP_API_GET, NULL, player_1_token);
assert(response.status == 200U && strstr(response.body, "\"viewer\":\"player1\"") != NULL &&
strstr(response.body, "\"match\":[[") != NULL && strstr(response.body, "\"cumulative\":[[") != NULL);
response = call(&api, HTTP_API_ROUTE_STATISTICS, HTTP_API_GET, NULL, "bad");
expect_code(&response, 401U, "UNAUTHORIZED");
snprintf(command, sizeof(command), "{\"token\":\"%s\",\"gameId\":1,\"x\":10,\"y\":0}", player_1_token);
response = call(&api, HTTP_API_ROUTE_SHOT, HTTP_API_POST, command, NULL);