From 04da143dce2d430dcc14e8a45c31177a23d7e301 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 8 Aug 2017 14:52:44 +0200 Subject: test: Add checks for duplicate vendor attributes --- p11-kit/test-uri.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'p11-kit') diff --git a/p11-kit/test-uri.c b/p11-kit/test-uri.c index 931c135..eb743b4 100644 --- a/p11-kit/test-uri.c +++ b/p11-kit/test-uri.c @@ -1542,6 +1542,16 @@ test_uri_vendor_query (void) ret = p11_kit_uri_set_vendor_query (uri, "my-query-three", NULL); assert_num_eq (0, ret); + /* Check if duplicate vendor query attributes are accepted and + * sorted alphabetically. */ + ret = p11_kit_uri_parse ("pkcs11:?bbb=zzz&aaa=xxx&aaa=yyy", P11_KIT_URI_FOR_ANY, uri); + assert_num_eq (P11_KIT_URI_OK, ret); + + ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); + assert_num_eq (P11_KIT_URI_OK, ret); + assert_str_eq ("pkcs11:?aaa=xxx&aaa=yyy&bbb=zzz", string); + free (string); + p11_kit_uri_free (uri); } -- cgit v1.1