Skip to content

Commit 05ac598

Browse files
committed
revise cmd_parms setup
Signed-off-by: Hans Zandbelt <[email protected]>
1 parent aaa4c55 commit 05ac598

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

test/helper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ void oidc_test_teardown(void);
5555
int oidc_test_suite_run(Suite *s);
5656
apr_pool_t *oidc_test_pool_get();
5757
request_rec *oidc_test_request_get();
58+
cmd_parms *oidc_test_cmd_get(const char *primitive);
5859

5960
#endif // _MOD_AUTH_OPENIDC_TEST_COMMON_H_

test/test_cfg.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,36 +44,28 @@
4444
#include "cfg/provider.h"
4545
#include "helper.h"
4646

47-
#include <http_config.h>
48-
49-
static cmd_parms cmd = {};
50-
5147
// provider
5248

5349
START_TEST(test_cmd_provider_token_endpoint_auth_set) {
5450
void *ptr = NULL;
5551
const char *arg = NULL;
5652
const char *rv = NULL;
57-
58-
cmd.server = oidc_test_request_get()->server;
59-
cmd.pool = oidc_test_request_get()->pool;
60-
cmd.directive = apr_pcalloc(cmd.pool, sizeof(ap_directive_t));
61-
cmd.directive->directive = OIDCProviderTokenEndpointAuth;
53+
cmd_parms *cmd = oidc_test_cmd_get(OIDCProviderTokenEndpointAuth);
6254

6355
arg = "private_key_jwt";
64-
rv = oidc_cmd_provider_token_endpoint_auth_set(&cmd, ptr, arg);
56+
rv = oidc_cmd_provider_token_endpoint_auth_set(cmd, ptr, arg);
6557
ck_assert_msg(rv == NULL, "failed: %s", rv);
6658

6759
arg = "private_key_jws";
68-
rv = oidc_cmd_provider_token_endpoint_auth_set(&cmd, ptr, arg);
60+
rv = oidc_cmd_provider_token_endpoint_auth_set(cmd, ptr, arg);
6961
ck_assert_msg(rv != NULL, "should have failed");
7062

7163
arg = "private_key_jwt:RS256";
72-
rv = oidc_cmd_provider_token_endpoint_auth_set(&cmd, ptr, arg);
64+
rv = oidc_cmd_provider_token_endpoint_auth_set(cmd, ptr, arg);
7365
ck_assert_msg(rv == NULL, "failed: %s", rv);
7466

7567
arg = "private_key_jwt:RA256";
76-
rv = oidc_cmd_provider_token_endpoint_auth_set(&cmd, ptr, arg);
68+
rv = oidc_cmd_provider_token_endpoint_auth_set(cmd, ptr, arg);
7769
ck_assert_msg(rv != NULL, "should have failed");
7870
}
7971
END_TEST

0 commit comments

Comments
 (0)