Lines Matching refs:param

73 static int test_param_type_null(OSSL_PARAM *param)  in test_param_type_null()  argument
80 switch(param->data_type) { in test_param_type_null()
82 if (param->data_size == sizeof(int32_t)) in test_param_type_null()
83 rc = OSSL_PARAM_get_int32(param, (int32_t *)&intval); in test_param_type_null()
84 else if (param->data_size == sizeof(uint64_t)) in test_param_type_null()
85 rc = OSSL_PARAM_get_int64(param, (int64_t *)&intval); in test_param_type_null()
90 if (param->data_size == sizeof(uint32_t)) in test_param_type_null()
91 rc = OSSL_PARAM_get_uint32(param, (uint32_t *)&intval); in test_param_type_null()
92 else if (param->data_size == sizeof(uint64_t)) in test_param_type_null()
93 rc = OSSL_PARAM_get_uint64(param, &intval); in test_param_type_null()
95 rc = OSSL_PARAM_get_BN(param, &bn); in test_param_type_null()
98 rc = OSSL_PARAM_get_double(param, &dval); in test_param_type_null()
116 static int test_param_type_extra(OSSL_PARAM *param, const unsigned char *cmp, in test_param_type_extra() argument
123 const int bit32 = param->data_size <= sizeof(int32_t); in test_param_type_extra()
124 const int sizet = param->data_size <= sizeof(size_t); in test_param_type_extra()
125 const int signd = param->data_type == OSSL_PARAM_INTEGER; in test_param_type_extra()
131 param->return_size = OSSL_PARAM_UNMODIFIED; in test_param_type_extra()
133 if ((bit32 && !TEST_true(OSSL_PARAM_get_int32(param, &i32))) in test_param_type_extra()
134 || !TEST_true(OSSL_PARAM_get_int64(param, &i64))) in test_param_type_extra()
138 && !TEST_true(OSSL_PARAM_get_uint32(param, (uint32_t *)&i32))) in test_param_type_extra()
139 || !TEST_true(OSSL_PARAM_get_uint64(param, (uint64_t *)&i64)) in test_param_type_extra()
140 || (sizet && !TEST_true(OSSL_PARAM_get_size_t(param, &s)))) in test_param_type_extra()
143 if (!TEST_false(OSSL_PARAM_modified(param))) in test_param_type_extra()
167 if (!TEST_true(OSSL_PARAM_set_int32(param, 12345)) in test_param_type_extra()
168 || !TEST_true(OSSL_PARAM_get_int64(param, &i64)) in test_param_type_extra()
172 if (!TEST_true(OSSL_PARAM_set_uint32(param, 12345)) in test_param_type_extra()
173 || !TEST_true(OSSL_PARAM_get_uint64(param, (uint64_t *)&i64)) in test_param_type_extra()
177 if (!TEST_true(OSSL_PARAM_modified(param))) in test_param_type_extra()
201 OSSL_PARAM param = OSSL_PARAM_int("a", NULL); in test_param_int() local
203 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_int()
209 param.data = &out; in test_param_int()
210 if (!TEST_true(OSSL_PARAM_set_int(&param, in))) in test_param_int()
216 if (!TEST_true(OSSL_PARAM_get_int(&param, &in))) in test_param_int()
221 param.data = &out; in test_param_int()
222 return test_param_type_extra(&param, raw_values[n].value, sizeof(int)); in test_param_int()
231 OSSL_PARAM param = OSSL_PARAM_long("a", NULL); in test_param_long() local
233 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_long()
239 param.data = &out; in test_param_long()
240 if (!TEST_true(OSSL_PARAM_set_long(&param, in))) in test_param_long()
246 if (!TEST_true(OSSL_PARAM_get_long(&param, &in))) in test_param_long()
251 param.data = &out; in test_param_long()
252 return test_param_type_extra(&param, raw_values[n].value, sizeof(long int)); in test_param_long()
260 OSSL_PARAM param = OSSL_PARAM_uint("a", NULL); in test_param_uint() local
262 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_uint()
268 param.data = &out; in test_param_uint()
269 if (!TEST_true(OSSL_PARAM_set_uint(&param, in))) in test_param_uint()
275 if (!TEST_true(OSSL_PARAM_get_uint(&param, &in))) in test_param_uint()
280 param.data = &out; in test_param_uint()
281 return test_param_type_extra(&param, raw_values[n].value, sizeof(unsigned int)); in test_param_uint()
290 OSSL_PARAM param = OSSL_PARAM_ulong("a", NULL); in test_param_ulong() local
292 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_ulong()
298 param.data = &out; in test_param_ulong()
299 if (!TEST_true(OSSL_PARAM_set_ulong(&param, in))) in test_param_ulong()
305 if (!TEST_true(OSSL_PARAM_get_ulong(&param, &in))) in test_param_ulong()
310 param.data = &out; in test_param_ulong()
311 return test_param_type_extra(&param, raw_values[n].value, sizeof(unsigned long int)); in test_param_ulong()
320 OSSL_PARAM param = OSSL_PARAM_int32("a", NULL); in test_param_int32() local
322 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_int32()
328 param.data = &out; in test_param_int32()
329 if (!TEST_true(OSSL_PARAM_set_int32(&param, in))) in test_param_int32()
335 if (!TEST_true(OSSL_PARAM_get_int32(&param, &in))) in test_param_int32()
340 param.data = &out; in test_param_int32()
341 return test_param_type_extra(&param, raw_values[n].value, sizeof(int32_t)); in test_param_int32()
350 OSSL_PARAM param = OSSL_PARAM_uint32("a", NULL); in test_param_uint32() local
352 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_uint32()
358 param.data = &out; in test_param_uint32()
359 if (!TEST_true(OSSL_PARAM_set_uint32(&param, in))) in test_param_uint32()
365 if (!TEST_true(OSSL_PARAM_get_uint32(&param, &in))) in test_param_uint32()
370 param.data = &out; in test_param_uint32()
371 return test_param_type_extra(&param, raw_values[n].value, sizeof(uint32_t)); in test_param_uint32()
380 OSSL_PARAM param = OSSL_PARAM_int64("a", NULL); in test_param_int64() local
382 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_int64()
388 param.data = &out; in test_param_int64()
389 if (!TEST_true(OSSL_PARAM_set_int64(&param, in))) in test_param_int64()
395 if (!TEST_true(OSSL_PARAM_get_int64(&param, &in))) in test_param_int64()
400 param.data = &out; in test_param_int64()
401 return test_param_type_extra(&param, raw_values[n].value, sizeof(int64_t)); in test_param_int64()
410 OSSL_PARAM param = OSSL_PARAM_uint64("a", NULL); in test_param_uint64() local
412 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_uint64()
418 param.data = &out; in test_param_uint64()
419 if (!TEST_true(OSSL_PARAM_set_uint64(&param, in))) in test_param_uint64()
425 if (!TEST_true(OSSL_PARAM_get_uint64(&param, &in))) in test_param_uint64()
430 param.data = &out; in test_param_uint64()
431 return test_param_type_extra(&param, raw_values[n].value, sizeof(uint64_t)); in test_param_uint64()
440 OSSL_PARAM param = OSSL_PARAM_size_t("a", NULL); in test_param_size_t() local
442 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_size_t()
448 param.data = &out; in test_param_size_t()
449 if (!TEST_true(OSSL_PARAM_set_size_t(&param, in))) in test_param_size_t()
455 if (!TEST_true(OSSL_PARAM_get_size_t(&param, &in))) in test_param_size_t()
460 param.data = &out; in test_param_size_t()
461 return test_param_type_extra(&param, raw_values[n].value, sizeof(size_t)); in test_param_size_t()
470 OSSL_PARAM param = OSSL_PARAM_time_t("a", NULL); in test_param_time_t() local
472 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_time_t()
478 param.data = &out; in test_param_time_t()
479 if (!TEST_true(OSSL_PARAM_set_time_t(&param, in))) in test_param_time_t()
485 if (!TEST_true(OSSL_PARAM_get_time_t(&param, &in))) in test_param_time_t()
490 param.data = &out; in test_param_time_t()
491 return test_param_type_extra(&param, raw_values[n].value, sizeof(size_t)); in test_param_time_t()
499 OSSL_PARAM param = OSSL_PARAM_DEFN("bn", OSSL_PARAM_UNSIGNED_INTEGER, in test_param_bignum() local
503 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_bignum()
506 param.data = bnbuf; in test_param_bignum()
507 param.data_size = sizeof(bnbuf); in test_param_bignum()
512 if (!TEST_true(OSSL_PARAM_set_BN(&param, b))) in test_param_bignum()
517 param.data_size = param.return_size; in test_param_bignum()
518 if (!TEST_true(OSSL_PARAM_get_BN(&param, &c)) in test_param_bignum()
534 OSSL_PARAM param = OSSL_PARAM_DEFN("bn", OSSL_PARAM_INTEGER, NULL, 0); in test_param_signed_bignum() local
537 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_signed_bignum()
540 param.data = bnbuf; in test_param_signed_bignum()
541 param.data_size = sizeof(bnbuf); in test_param_signed_bignum()
549 if (!TEST_true(OSSL_PARAM_set_BN(&param, b))) in test_param_signed_bignum()
554 param.data_size = param.return_size; in test_param_signed_bignum()
555 if (!TEST_true(OSSL_PARAM_get_BN(&param, &c)) in test_param_signed_bignum()
571 OSSL_PARAM param = OSSL_PARAM_double("r", NULL); in test_param_real() local
573 if (!TEST_int_eq(test_param_type_null(&param), 1)) in test_param_real()
576 param.data = &p; in test_param_real()
577 return TEST_true(OSSL_PARAM_set_double(&param, 3.14159)) in test_param_real()
762 OSSL_PARAM param[3] = { OSSL_PARAM_int("a", NULL), in test_param_modified() local
767 param->data = &a; in test_param_modified()
768 param[1].data = &b; in test_param_modified()
769 if (!TEST_false(OSSL_PARAM_modified(param)) in test_param_modified()
770 && !TEST_true(OSSL_PARAM_set_int32(param, 1234)) in test_param_modified()
771 && !TEST_true(OSSL_PARAM_modified(param)) in test_param_modified()
772 && !TEST_false(OSSL_PARAM_modified(param + 1)) in test_param_modified()
773 && !TEST_true(OSSL_PARAM_set_int32(param + 1, 1)) in test_param_modified()
774 && !TEST_true(OSSL_PARAM_modified(param + 1))) in test_param_modified()
776 OSSL_PARAM_set_all_unmodified(param); in test_param_modified()
777 if (!TEST_false(OSSL_PARAM_modified(param)) in test_param_modified()
778 && !TEST_true(OSSL_PARAM_set_int32(param, 4321)) in test_param_modified()
779 && !TEST_true(OSSL_PARAM_modified(param)) in test_param_modified()
780 && !TEST_false(OSSL_PARAM_modified(param + 1)) in test_param_modified()
781 && !TEST_true(OSSL_PARAM_set_int32(param + 1, 2)) in test_param_modified()
782 && !TEST_true(OSSL_PARAM_modified(param + 1))) in test_param_modified()
792 OSSL_PARAM param[3]; in test_param_copy_null() local
794 param[i++] = OSSL_PARAM_construct_int("a", &a); in test_param_copy_null()
795 param[i++] = OSSL_PARAM_construct_int("b", &b); in test_param_copy_null()
796 param[i] = OSSL_PARAM_construct_end(); in test_param_copy_null()
799 && TEST_ptr(cp1 = OSSL_PARAM_merge(NULL, param)) in test_param_copy_null()
806 && TEST_ptr(cp2 = OSSL_PARAM_merge(param, NULL)) in test_param_copy_null()