Lines Matching refs:pc

35 static int param_conversion_load_stanza(PARAM_CONVERSION *pc, const STANZA *s)  in param_conversion_load_stanza()  argument
57 memset(pc, 0, sizeof(*pc)); in param_conversion_load_stanza()
66 pc->param = OSSL_PARAM_locate(params, type = pp->value); in param_conversion_load_stanza()
67 if (pc->param == NULL) { in param_conversion_load_stanza()
77 pc->valid_i32 = 1; in param_conversion_load_stanza()
78 pc->i32 = (int32_t)strtoimax(pp->value, &p, 10); in param_conversion_load_stanza()
86 pc->valid_i64 = 1; in param_conversion_load_stanza()
87 pc->i64 = (int64_t)strtoimax(pp->value, &p, 10); in param_conversion_load_stanza()
95 pc->valid_u32 = 1; in param_conversion_load_stanza()
96 pc->u32 = (uint32_t)strtoumax(pp->value, &p, 10); in param_conversion_load_stanza()
104 pc->valid_u64 = 1; in param_conversion_load_stanza()
105 pc->u64 = (uint64_t)strtoumax(pp->value, &p, 10); in param_conversion_load_stanza()
113 pc->valid_d = 1; in param_conversion_load_stanza()
114 pc->d = strtod(pp->value, &p); in param_conversion_load_stanza()
133 if (!TEST_true(def_i32) || !TEST_true(pc->valid_i32)) { in param_conversion_load_stanza()
137 datum_i32 = ref_i32 = pc->i32; in param_conversion_load_stanza()
138 pc->datum = &datum_i32; in param_conversion_load_stanza()
139 pc->ref = &ref_i32; in param_conversion_load_stanza()
140 pc->size = sizeof(ref_i32); in param_conversion_load_stanza()
142 if (!TEST_true(def_i64) || !TEST_true(pc->valid_i64)) { in param_conversion_load_stanza()
146 datum_i64 = ref_i64 = pc->i64; in param_conversion_load_stanza()
147 pc->datum = &datum_i64; in param_conversion_load_stanza()
148 pc->ref = &ref_i64; in param_conversion_load_stanza()
149 pc->size = sizeof(ref_i64); in param_conversion_load_stanza()
151 if (!TEST_true(def_u32) || !TEST_true(pc->valid_u32)) { in param_conversion_load_stanza()
155 datum_u32 = ref_u32 = pc->u32; in param_conversion_load_stanza()
156 pc->datum = &datum_u32; in param_conversion_load_stanza()
157 pc->ref = &ref_u32; in param_conversion_load_stanza()
158 pc->size = sizeof(ref_u32); in param_conversion_load_stanza()
160 if (!TEST_true(def_u64) || !TEST_true(pc->valid_u64)) { in param_conversion_load_stanza()
164 datum_u64 = ref_u64 = pc->u64; in param_conversion_load_stanza()
165 pc->datum = &datum_u64; in param_conversion_load_stanza()
166 pc->ref = &ref_u64; in param_conversion_load_stanza()
167 pc->size = sizeof(ref_u64); in param_conversion_load_stanza()
169 if (!TEST_true(def_d) || !TEST_true(pc->valid_d)) { in param_conversion_load_stanza()
173 datum_d = ref_d = pc->d; in param_conversion_load_stanza()
174 pc->datum = &datum_d; in param_conversion_load_stanza()
175 pc->ref = &ref_d; in param_conversion_load_stanza()
176 pc->size = sizeof(ref_d); in param_conversion_load_stanza()
184 static int param_conversion_test(const PARAM_CONVERSION *pc, int line) in param_conversion_test() argument
192 if (!pc->valid_i32) { in param_conversion_test()
193 if (!TEST_false(OSSL_PARAM_get_int32(pc->param, &i32)) in param_conversion_test()
199 if (!TEST_true(OSSL_PARAM_get_int32(pc->param, &i32)) in param_conversion_test()
200 || !TEST_true(i32 == pc->i32)) { in param_conversion_test()
204 memset(pc->datum, 44, pc->size); in param_conversion_test()
205 if (!TEST_true(OSSL_PARAM_set_int32(pc->param, i32)) in param_conversion_test()
206 || !TEST_mem_eq(pc->datum, pc->size, pc->ref, pc->size)) { in param_conversion_test()
213 if (!pc->valid_i64) { in param_conversion_test()
214 if (!TEST_false(OSSL_PARAM_get_int64(pc->param, &i64)) in param_conversion_test()
220 if (!TEST_true(OSSL_PARAM_get_int64(pc->param, &i64)) in param_conversion_test()
221 || !TEST_true(i64 == pc->i64)) { in param_conversion_test()
225 memset(pc->datum, 44, pc->size); in param_conversion_test()
226 if (!TEST_true(OSSL_PARAM_set_int64(pc->param, i64)) in param_conversion_test()
227 || !TEST_mem_eq(pc->datum, pc->size, pc->ref, pc->size)) { in param_conversion_test()
234 if (!pc->valid_u32) { in param_conversion_test()
235 if (!TEST_false(OSSL_PARAM_get_uint32(pc->param, &u32)) in param_conversion_test()
241 if (!TEST_true(OSSL_PARAM_get_uint32(pc->param, &u32)) in param_conversion_test()
242 || !TEST_true(u32 == pc->u32)) { in param_conversion_test()
246 memset(pc->datum, 44, pc->size); in param_conversion_test()
247 if (!TEST_true(OSSL_PARAM_set_uint32(pc->param, u32)) in param_conversion_test()
248 || !TEST_mem_eq(pc->datum, pc->size, pc->ref, pc->size)) { in param_conversion_test()
255 if (!pc->valid_u64) { in param_conversion_test()
256 if (!TEST_false(OSSL_PARAM_get_uint64(pc->param, &u64)) in param_conversion_test()
262 if (!TEST_true(OSSL_PARAM_get_uint64(pc->param, &u64)) in param_conversion_test()
263 || !TEST_true(u64 == pc->u64)) { in param_conversion_test()
267 memset(pc->datum, 44, pc->size); in param_conversion_test()
268 if (!TEST_true(OSSL_PARAM_set_uint64(pc->param, u64)) in param_conversion_test()
269 || !TEST_mem_eq(pc->datum, pc->size, pc->ref, pc->size)) { in param_conversion_test()
276 if (!pc->valid_d) { in param_conversion_test()
277 if (!TEST_false(OSSL_PARAM_get_double(pc->param, &d)) in param_conversion_test()
283 if (!TEST_true(OSSL_PARAM_get_double(pc->param, &d))) { in param_conversion_test()
300 if (!TEST_false(pc->d == pc->d)) { in param_conversion_test()
304 } else if (!TEST_true(d == pc->d)) { in param_conversion_test()
308 memset(pc->datum, 44, pc->size); in param_conversion_test()
309 if (!TEST_true(OSSL_PARAM_set_double(pc->param, d)) in param_conversion_test()
310 || !TEST_mem_eq(pc->datum, pc->size, pc->ref, pc->size)) { in param_conversion_test()
323 PARAM_CONVERSION pc; in run_param_file_tests() local
340 if (!param_conversion_load_stanza(&pc, s) in run_param_file_tests()
341 || !param_conversion_test(&pc, s->curr)) in run_param_file_tests()