From 128239732a5b7e184d5d9c505402630ee9215080 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 18 Mar 2013 20:59:57 +0100 Subject: 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. --- common/tests/test-attrs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'common/tests/test-attrs.c') 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 -- cgit v1.1