diff options
Diffstat (limited to 'qa')
-rw-r--r-- | qa/test_api.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/qa/test_api.c b/qa/test_api.c index 399afdc..499d01f 100644 --- a/qa/test_api.c +++ b/qa/test_api.c @@ -91,7 +91,7 @@ int main(void) char data[256]; const char *val; int status; - struct nfct_bitmask *b; + struct nfct_bitmask *b, *b2; srand(time(NULL)); @@ -121,14 +121,23 @@ int main(void) eval_sigterm(status); } + b = nfct_bitmask_new(rand() & 0xffff); + assert(b); + b2 = nfct_bitmask_new(rand() & 0xffff); + assert(b2); + for (i=0; i<ATTR_MAX; i++) { - if (i != ATTR_CONNLABELS) { + switch (i) { + case ATTR_CONNLABELS: + nfct_set_attr(ct, i, b); + break; + case ATTR_CONNLABELS_MASK: + nfct_set_attr(ct, i, b2); + break; + default: nfct_set_attr(ct, i, data); - continue; + break; } - b = nfct_bitmask_new(rand() & 0xffff); - assert(b); - nfct_set_attr(ct, i, b); } printf("== test get API ==\n"); @@ -162,6 +171,7 @@ int main(void) nfct_set_attr_l(ct, i, data, sizeof(data)); break; case ATTR_CONNLABELS: + case ATTR_CONNLABELS_MASK: /* already set above */ break; default: @@ -173,6 +183,9 @@ int main(void) case ATTR_CONNLABELS: assert((void *) val == b); continue; + case ATTR_CONNLABELS_MASK: + assert((void *) val == b2); + continue; } if (val[0] != data[0]) { |