tests: Increase bitfield module test coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
38ff21931d
commit
56a1180153
1 changed files with 11 additions and 0 deletions
|
@ -168,6 +168,17 @@ static int bitfield_tests(void)
|
||||||
|
|
||||||
bitfield_free(bf);
|
bitfield_free(bf);
|
||||||
|
|
||||||
|
bf = bitfield_alloc(8);
|
||||||
|
if (bf == NULL)
|
||||||
|
return -1;
|
||||||
|
if (bitfield_get_first_zero(bf) != 0)
|
||||||
|
errors++;
|
||||||
|
for (i = 0; i < 8; i++)
|
||||||
|
bitfield_set(bf, i);
|
||||||
|
if (bitfield_get_first_zero(bf) != -1)
|
||||||
|
errors++;
|
||||||
|
bitfield_free(bf);
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
wpa_printf(MSG_ERROR, "%d bitfield test(s) failed", errors);
|
wpa_printf(MSG_ERROR, "%d bitfield test(s) failed", errors);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue