summaryrefslogtreecommitdiffstats
path: root/test/provfetchtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/provfetchtest.c')
-rw-r--r--test/provfetchtest.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/provfetchtest.c b/test/provfetchtest.c
index 95ae87910e..aae9b40057 100644
--- a/test/provfetchtest.c
+++ b/test/provfetchtest.c
@@ -225,6 +225,7 @@ static int dummy_provider_init(const OSSL_CORE_HANDLE *handle,
* Test 1: Encoder
* Test 2: Store loader
* Test 3: EVP_RAND
+ * Test 4-7: As above, but additionally with a query string
*/
static int fetch_test(int tst)
{
@@ -236,6 +237,7 @@ static int fetch_test(int tst)
OSSL_STORE_LOADER *loader = NULL;
int testresult = 0;
unsigned char buf[32];
+ int query = tst > 3;
if (!TEST_ptr(libctx))
goto err;
@@ -246,24 +248,29 @@ static int fetch_test(int tst)
|| !TEST_ptr(dummyprov = OSSL_PROVIDER_load(libctx, "dummy-prov")))
goto err;
- switch(tst) {
+ switch (tst % 4) {
case 0:
- decoder = OSSL_DECODER_fetch(libctx, "DUMMY", NULL);
+ decoder = OSSL_DECODER_fetch(libctx, "DUMMY",
+ query ? "provider=dummy" : NULL);
if (!TEST_ptr(decoder))
goto err;
break;
case 1:
- encoder = OSSL_ENCODER_fetch(libctx, "DUMMY", NULL);
+ encoder = OSSL_ENCODER_fetch(libctx, "DUMMY",
+ query ? "provider=dummy" : NULL);
if (!TEST_ptr(encoder))
goto err;
break;
case 2:
- loader = OSSL_STORE_LOADER_fetch(libctx, "DUMMY", NULL);
+ loader = OSSL_STORE_LOADER_fetch(libctx, "DUMMY",
+ query ? "provider=dummy" : NULL);
if (!TEST_ptr(loader))
goto err;
break;
case 3:
- if (!TEST_true(RAND_set_DRBG_type(libctx, "DUMMY", NULL, NULL, NULL))
+ if (!TEST_true(RAND_set_DRBG_type(libctx, "DUMMY",
+ query ? "provider=dummy" : NULL,
+ NULL, NULL))
|| !TEST_int_ge(RAND_bytes_ex(libctx, buf, sizeof(buf), 0), 1))
goto err;
break;
@@ -284,7 +291,7 @@ static int fetch_test(int tst)
int setup_tests(void)
{
- ADD_ALL_TESTS(fetch_test, 4);
+ ADD_ALL_TESTS(fetch_test, 8);
return 1;
}