Commit 9fce777
authored
test(internal): expand coverage for http_error (#1035)
Add tests/unit/http_error_coverage_test.cpp exercising branches not
reached by tests/test_network_config_http_error.cpp:
- get_error_status_text default/unknown-code arm
- http_error::is_client_error / is_server_error boundary values
(399, 400, 499, 500, 599, 600)
- parse_error::to_http_error with and without context
- http_error_response::make_error with/without detail and request_id
- build_json_error detail-fallback ternary, request_id if-branch,
escape_json_string switch (", \\, \b, \f, \n, \r, \t, low
control bytes, plain ASCII, high-bit bytes)
- build_html_error message / detail / request_id empty-vs-present
branches and escape_html_string switch (& < > " ' default)
- deterministic ISO-8601 timestamp rendering through strftime path
Tests are hermetic (no network, filesystem, or sleeps) and hit every
switch arm of the two file-local escape helpers plus every if-branch
of the JSON and HTML builders.
Closes #10231 parent fc5eae5 commit 9fce777
2 files changed
Lines changed: 434 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4740 | 4740 | | |
4741 | 4741 | | |
4742 | 4742 | | |
| 4743 | + | |
| 4744 | + | |
| 4745 | + | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
4743 | 4750 | | |
4744 | 4751 | | |
4745 | 4752 | | |
| |||
0 commit comments