summaryrefslogtreecommitdiff
path: root/common/tests
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-18 20:59:57 +0100
committerStef Walter <stefw@gnome.org>2013-03-18 21:54:48 +0100
commit128239732a5b7e184d5d9c505402630ee9215080 (patch)
tree8432e2758971c4eecf56881cfe55803831985079 /common/tests
parent1ad9f98b11f3f0d411bf9517f1dc8985ea3dbe2a (diff)
attrs: Change p11_attrs_to_string() to allow static templates
Allow passing the number of attributes to print, which lets us use this directly on templates passed in by callers of the PKCS#11 API.
Diffstat (limited to 'common/tests')
-rw-r--r--common/tests/test-attrs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/tests/test-attrs.c b/common/tests/test-attrs.c
index f1e6d91..61fcef3 100644
--- a/common/tests/test-attrs.c
+++ b/common/tests/test-attrs.c
@@ -474,9 +474,13 @@ test_to_string (CuTest *tc)
CuAssertStrEquals (tc, "{ CKA_LABEL = (3) \"yay\" }", string);
free (string);
- string = p11_attrs_to_string (attrs);
+ string = p11_attrs_to_string (attrs, -1);
CuAssertStrEquals (tc, "(2) [ { CKA_LABEL = (3) \"yay\" }, { CKA_VALUE = (5) NOT-PRINTED } ]", string);
free (string);
+
+ string = p11_attrs_to_string (attrs, 1);
+ CuAssertStrEquals (tc, "(1) [ { CKA_LABEL = (3) \"yay\" } ]", string);
+ free (string);
}
static void