Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openssl/openssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-04-21 03:49:19 +0300
committerPauli <paul.dale@oracle.com>2020-04-22 06:56:44 +0300
commit8d5fb6485282c79bfe9f1ebab14eab515910e370 (patch)
tree7fe3b356021db7eba7529a9569d2c61348324e99 /test
parent07caec83b81859ea9aa2d5075a394aa48c4e5fae (diff)
params: add functionality to test if an OSSL_PARAM has been set.
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11588)
Diffstat (limited to 'test')
-rw-r--r--test/params_api_test.c5
-rw-r--r--test/params_test.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/test/params_api_test.c b/test/params_api_test.c
index c403f39abd..d01044d0eb 100644
--- a/test/params_api_test.c
+++ b/test/params_api_test.c
@@ -69,6 +69,7 @@ static int test_param_type_extra(OSSL_PARAM *param, const unsigned char *cmp,
const int sizet = bit32 && sizeof(size_t) > sizeof(int32_t);
const int signd = param->data_type == OSSL_PARAM_INTEGER;
+ OSSL_PARAM_set_unmodified(param);
if (signd) {
if ((bit32 && !TEST_true(OSSL_PARAM_get_int32(param, &i32)))
|| !TEST_true(OSSL_PARAM_get_int64(param, &i64)))
@@ -80,6 +81,8 @@ static int test_param_type_extra(OSSL_PARAM *param, const unsigned char *cmp,
|| (sizet && !TEST_true(OSSL_PARAM_get_size_t(param, &s))))
return 0;
}
+ if (!TEST_false(OSSL_PARAM_modified(param)))
+ return 0;
/* Check signed types */
if (bit32) {
@@ -112,6 +115,8 @@ static int test_param_type_extra(OSSL_PARAM *param, const unsigned char *cmp,
|| !TEST_size_t_eq((size_t)i64, 12345))
return 0;
}
+ if (!TEST_true(OSSL_PARAM_modified(param)))
+ return 0;
}
return 1;
}
diff --git a/test/params_test.c b/test/params_test.c
index 339a51694f..5ed7d36a1e 100644
--- a/test/params_test.c
+++ b/test/params_test.c
@@ -467,8 +467,7 @@ static int test_case_variant(OSSL_PARAM *params, const struct provider_dispatch_
|| !TEST_size_t_eq(p->return_size, sizeof(p6_init)) /* "provider" value */
|| !TEST_str_eq(app_p6, p6_init) /* "provider" value */
|| !TEST_char_eq(foo[0], app_foo_init) /* Should remain untouched */
- || !TEST_ptr(p = OSSL_PARAM_locate(params, "foo"))
- || !TEST_int_eq(p->return_size, 0))
+ || !TEST_ptr(p = OSSL_PARAM_locate(params, "foo")))
errcnt++;
/*
@@ -519,8 +518,7 @@ static int test_case_variant(OSSL_PARAM *params, const struct provider_dispatch_
sizeof(app_p6_init)) /* app value */
|| !TEST_str_eq(app_p6, app_p6_init) /* app value */
|| !TEST_char_eq(foo[0], app_foo_init) /* Should remain untouched */
- || !TEST_ptr(p = OSSL_PARAM_locate(params, "foo"))
- || !TEST_int_eq(p->return_size, 0))
+ || !TEST_ptr(p = OSSL_PARAM_locate(params, "foo")))
errcnt++;
fin: