summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2012-11-19 14:29:51 +0100
committerFlorian Westphal <fw@strlen.de>2012-11-22 23:21:22 +0100
commit4984b297a3fa6f79ab9162617b9c90aca76d6f70 (patch)
tree8e847c93546ff49f1d77cb561c8922683be3d644
parent1044ffcc44ad49b27467548ac79b03d9861c8a45 (diff)
qa: fix handling of ATTR_HELPER_INFO attribute
The attribute is variable-length and must be thus be set via set_attr_l(). Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--qa/test_api.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/qa/test_api.c b/qa/test_api.c
index d5f95e9..e44c228 100644
--- a/qa/test_api.c
+++ b/qa/test_api.c
@@ -83,9 +83,6 @@ int main(void)
ret = fork();
if (ret == 0) {
for (i=0; i<ATTR_MAX; i++) {
- data[0] = (uint8_t) i;
- nfct_set_attr(ct, i, data);
- val = nfct_get_attr(ct, i);
/* These attributes cannot be set, ignore them. */
switch(i) {
case ATTR_ORIG_COUNTER_PACKETS:
@@ -96,8 +93,18 @@ int main(void)
case ATTR_SECCTX:
case ATTR_TIMESTAMP_START:
case ATTR_TIMESTAMP_STOP:
+ case ATTR_CONNLABELS:
continue;
+ /* These attributes require special handling */
+ case ATTR_HELPER_INFO:
+ nfct_set_attr_l(ct, i, data, sizeof(data));
+ break;
+ default:
+ data[0] = (uint8_t) i;
+ nfct_set_attr(ct, i, data);
}
+ val = nfct_get_attr(ct, i);
+
if (val[0] != data[0]) {
printf("ERROR: set/get operations don't match "
"for attribute %d (%x != %x)\n",