Repository navigation
test(app): smoke tests for named routes, healthz, and set_error_handler (#342) - #388
Open
Bhumika-1432006 wants to merge 1 commit into
Open
Bhumika-1432006 wants to merge 1 commit into
Bhumika-1432006 wants to merge 1 commit into
Conversation
…er (c4punks#342) Four cwist_app_* functions from issue c4punks#342's uncovered list have no test: cwist_app_post_named, cwist_app_delete_named, cwist_app_enable_healthz, and cwist_app_set_error_handler. This adds tests/test_app_named_routes_and_error_handler.c with one case per function: - post_named: register a POST route with a name and verify cwist_url_for returns the registered path. - delete_named: same for DELETE; confirms :param paths are stored. - enable_healthz: call it and confirm no crash; check cwist_url_for for the /healthz path when a name is registered. - set_error_handler: verify app->error_handler is NULL before the call, set to the supplied function pointer after, and NULL-cleared on a second call with NULL. Confirm NULL app is a safe no-op. No live server is started; the tests only exercise registration and lookup. The test is wired into make test via a new Makefile target.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four cwist_app_* functions from issue #342's uncovered list have no test: cwist_app_post_named, cwist_app_delete_named, cwist_app_enable_healthz, and cwist_app_set_error_handler.
What this adds: tests/test_app_named_routes_and_error_handler.c with one case per function:
How it was verified: no live server is started; the tests only exercise the registration and lookup paths. The assertions follow directly from the function signatures and the app struct layout in app.h. The test is wired into make test via a new Makefile target.
What it does not do: does not cover cwist_app_multiport, cwist_app_set_tls_groups, cwist_app_ws_opt, or the other uncovered functions listed in issue #342.