diff --git a/test/fko-wrapper/fko_wrapper.c b/test/fko-wrapper/fko_wrapper.c index 4378051c..d49024fc 100644 --- a/test/fko-wrapper/fko_wrapper.c +++ b/test/fko-wrapper/fko_wrapper.c @@ -13,15 +13,25 @@ #define FCN_CALLS 5 #define CTX_DESTROY 0 #define NO_CTX_DESTROY 1 +#define NEW_CTX 0 +#define NO_NEW_CTX 1 static void display_ctx(fko_ctx_t ctx); -static void test_loop(int destroy_ctx_flag); +static void test_loop(int new_ctx_flag, int destroy_ctx_flag); +static void spa_func_exec_int(fko_ctx_t *ctx, char *name, + int (*spa_func)(fko_ctx_t ctx, const int modifier), int min, int max, + int final_val, int new_ctx_flag, int destroy_ctx_flag); +static void spa_func_exec_short(fko_ctx_t *ctx, char *name, + int (*spa_func)(fko_ctx_t ctx, const short modifier), int min, int max, + int final_val, int new_ctx_flag, int destroy_ctx_flag); int main(void) { int i; - test_loop(NO_CTX_DESTROY); - test_loop(CTX_DESTROY); + test_loop(NO_NEW_CTX, NO_CTX_DESTROY); + test_loop(NEW_CTX, CTX_DESTROY); + test_loop(NEW_CTX, NO_CTX_DESTROY); + test_loop(NO_NEW_CTX, CTX_DESTROY); /* call fko_errstr() across valid and invalid values */ @@ -32,53 +42,28 @@ int main(void) { } static void -test_loop(int destroy_ctx_flag) +test_loop(int new_ctx_flag, int destroy_ctx_flag) { fko_ctx_t ctx = NULL, decrypt_ctx = NULL; int i; char *spa_data = NULL; + printf("fko_new(): %s\n", fko_errstr(fko_new(&ctx))); + fko_destroy(ctx); + ctx = NULL; printf("fko_new(): %s\n", fko_errstr(fko_new(&ctx))); - for (i=0; i