Lines Matching refs:h

23 static int helper_ensure(struct helper *h)  in helper_ensure()  argument
25 if (h->init) in helper_ensure()
28 if (!TEST_ptr(h->mem_bio = BIO_new(BIO_s_mem()))) in helper_ensure()
31 if (!ossl_json_init(&h->j, h->mem_bio, h->flags)) { in helper_ensure()
32 BIO_free_all(h->mem_bio); in helper_ensure()
33 h->mem_bio = NULL; in helper_ensure()
37 h->init = 1; in helper_ensure()
41 static void helper_cleanup(struct helper *h) in helper_cleanup() argument
43 BIO_free_all(h->mem_bio); in helper_cleanup()
44 h->mem_bio = NULL; in helper_cleanup()
46 if (h->init) { in helper_cleanup()
47 ossl_json_cleanup(&h->j); in helper_cleanup()
48 h->init = 0; in helper_cleanup()
52 static void helper_set_flags(struct helper *h, uint32_t flags) in helper_set_flags() argument
54 helper_cleanup(h); in helper_set_flags()
55 h->flags = flags; in helper_set_flags()
550 struct helper h = {0}; in run_script() local
566 helper_set_flags(&h, (uint32_t)GET_U64()); in run_script()
572 if (!TEST_true(helper_ensure(&h))) in run_script()
575 f(&h.j); in run_script()
582 if (!TEST_true(helper_ensure(&h))) in run_script()
585 f(&h.j, (int)GET_I64()); in run_script()
592 if (!TEST_true(helper_ensure(&h))) in run_script()
595 f(&h.j, GET_U64()); in run_script()
602 if (!TEST_true(helper_ensure(&h))) in run_script()
605 f(&h.j, GET_I64()); in run_script()
612 if (!TEST_true(helper_ensure(&h))) in run_script()
615 f(&h.j, GET_P()); in run_script()
624 if (!TEST_true(helper_ensure(&h))) in run_script()
629 f(&h.j, p, (size_t)u64); in run_script()
634 if (!TEST_true(helper_ensure(&h))) in run_script()
638 if (!TEST_int_eq(ossl_json_in_error(&h.j), asserted)) in run_script()
651 if (!TEST_true(helper_ensure(&h))) in run_script()
654 if (!TEST_true(ossl_json_flush(&h.j))) in run_script()
658 if (asserted < 0 && !TEST_false(ossl_json_in_error(&h.j))) in run_script()
661 if (!TEST_true(BIO_get_mem_ptr(h.mem_bio, &bufp))) in run_script()
676 helper_cleanup(&h); in run_script()