GCC Code Coverage Report


Directory: src/gate/
File: src/gate/net/tests/gatenet_test/test_http.c
Date: 2025-09-14 13:10:38
Exec Total Coverage
Lines: 16 16 100.0%
Functions: 3 3 100.0%
Branches: 2 4 50.0%

Line Branch Exec Source
1 #include "test_http.h"
2 #include "gate/net/httpclients.h"
3 #include "gate/net/httpservers.h"
4 #include "gate/strings.h"
5
6 1 static gate_bool_t test_httpserver()
7 {
8 gate_result_t result;
9 gate_httpserver_t server;
10
11 1 GATE_TEST_UNIT_BEGIN(test_httpserver);
12
13 1 result = gate_httpserver_create(&server);
14
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 GATE_TEST_REQUIRE_OK(result);
15
16 1 result = gate_httpserver_destroy(&server);
17
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 GATE_TEST_CHECK_OK(result);
18
19 1 GATE_TEST_UNIT_END;
20 }
21
22 1 static gate_bool_t test_httpclient()
23 {
24 gate_result_t result;
25 gate_httpclient_t client;
26 1 gate_string_t localhost_addr = GATE_STRING_INIT_STATIC("127.0.0.1");
27
28 1 GATE_TEST_UNIT_BEGIN(test_httpclient);
29
30 //result = gate_httpclient_create(&client, &localhost_addr, 8765, GATE_HTTPCLIENT_FLAG_NATIVE_IMPL);
31 //GATE_TEST_CHECK(result);
32
33 1 GATE_TEST_UNIT_END;
34 }
35
36 1 GATE_TEST_FUNCTION(test_http)
37 {
38 1 gate_bool_t succeeded = true;
39
40 1 succeeded |= test_httpserver();
41 1 succeeded |= test_httpclient();
42
43 1 return succeeded;
44 }
45