Skip to content

test(app): cover named/opt route helpers and set_session_max_age (closes #390) - #394

Merged
gg582 merged 2 commits into
c4punks:devfrom
Bhumika-1432006:test/390-route-helpers
Oct 18, 2026
Merged

gg582 merged 2 commits into
c4punks:devfrom
Bhumika-1432006:test/390-route-helpers

Conversation

@Bhumika-1432006

Copy link
Copy Markdown
Contributor

What it does

Adds tests/test_app_route_helpers.c covering the nine route-registration helpers that were listed in scripts/ci/api-untested-baseline.txt:

  • cwist_app_get_named, cwist_app_put_named, cwist_app_patch_named — register named routes and confirm cwist_url_for resolves them.
  • cwist_app_get_opt, cwist_app_post_opt, cwist_app_put_opt, cwist_app_patch_opt, cwist_app_delete_opt — smoke-test with a zeroed cwist_endpoint_opt_t; assert no crash and route resolves.
  • cwist_app_set_session_max_age — call with positive, zero, and NULL app; assert no crash.

Pattern follows tests/test_app_named_routes_and_error_handler.c (#388): registration-and-lookup only, no live server.

How verified

make test_app_route_helpers

Target compiles and exits 0.

python3 scripts/ci/check_api_test_coverage.py

Exits 0; the nine covered names are removed from scripts/ci/api-untested-baseline.txt.

What this does NOT do

Does not test started servers, TLS, websocket, or any database path.

@gg582
gg582 merged commit dee4a45 into c4punks:dev Oct 18, 2026
24 checks passed
gg582 added a commit that referenced this pull request Oct 18, 2026
 #390) (#394)

* test(app): cover named/opt route helpers and set_session_max_age (closes #390)

* test(app): trim restating comments in route-helper tests

---------

Co-authored-by: Lee Yunjin <gzblues61@daum.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants