diff options
author | Stef Walter <stefw@redhat.com> | 2014-09-04 15:56:02 +0200 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2014-09-10 08:03:09 +0200 |
commit | 9ba2165ef75c63960ce95c9b1b085a0a630cfb14 (patch) | |
tree | 514ceec29b9c99fe85e335252b7b002b9a1a9a82 /common/test-constants.c | |
parent | 1ede9a957c5a4f2c44b6bc88ba380a41c145a81b (diff) | |
download | p11-kit-9ba2165ef75c63960ce95c9b1b085a0a630cfb14.tar.gz |
common: Add support for multiple field names (ie: nicks) per constant
This allows us to have old/new names for a given constant.
https://bugs.freedesktop.org/show_bug.cgi?id=83495
Diffstat (limited to 'common/test-constants.c')
-rw-r--r-- | common/test-constants.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/test-constants.c b/common/test-constants.c index 9adc81a..577d611 100644 --- a/common/test-constants.c +++ b/common/test-constants.c @@ -49,7 +49,7 @@ test_constants (void *arg) const p11_constant *constant = arg; p11_dict *nicks, *names; CK_ULONG check; - int i; + int i, j; nicks = p11_constant_reverse (true); names = p11_constant_reverse (false); @@ -61,16 +61,16 @@ test_constants (void *arg) for (i = 0; constant[i].value != CKA_INVALID; i++) { assert_ptr_not_null (constant[i].name); - if (constant[i].nick) { - assert_str_eq (constant[i].nick, + if (constant[i].nicks[0]) { + assert_str_eq (constant[i].nicks[0], p11_constant_nick (constant, constant[i].value)); } assert_str_eq (constant[i].name, p11_constant_name (constant, constant[i].value)); - if (constant[i].nick) { - check = p11_constant_resolve (nicks, constant[i].nick); + for (j = 0; constant[i].nicks[j] != NULL; j++) { + check = p11_constant_resolve (nicks, constant[i].nicks[j]); assert_num_eq (constant[i].value, check); } |