property_test: use property values that are not used elsewhere
authorTomas Mraz <tomas@openssl.org>
Tue, 16 Mar 2021 12:26:24 +0000 (13:26 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 16 Mar 2021 12:31:08 +0000 (13:31 +0100)
In test_property_query_value_create() we depend on the property
values to not be created by other test cases. Use such
values.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14573)

test/property_test.c

index add16ea6295e345381f943ff1c356860a775483d..d2255a26b4d2647d52bebd48a064815f8de9bbb5 100644 (file)
@@ -129,11 +129,12 @@ static int test_property_query_value_create(void)
     OSSL_PROPERTY_LIST *p = NULL, *q = NULL, *o = NULL;
     int r = 0;
 
+    /* The property value used here must not be used in other test cases */
     if (TEST_ptr(store = ossl_method_store_new(NULL))
-        && add_property_names("sky", NULL)
-        && TEST_ptr(p = ossl_parse_query(NULL, "sky=green", 0)) /* undefined */
-        && TEST_ptr(q = ossl_parse_query(NULL, "sky=green", 1)) /* creates */
-        && TEST_ptr(o = ossl_parse_query(NULL, "sky=green", 0)) /* defined */
+        && add_property_names("wood", NULL)
+        && TEST_ptr(p = ossl_parse_query(NULL, "wood=oak", 0)) /* undefined */
+        && TEST_ptr(q = ossl_parse_query(NULL, "wood=oak", 1)) /* creates */
+        && TEST_ptr(o = ossl_parse_query(NULL, "wood=oak", 0)) /* defined */
         && TEST_int_eq(ossl_property_match_count(q, p), -1)
         && TEST_int_eq(ossl_property_match_count(q, o), 1))
         r = 1;