From: Jouni Malinen Date: Sat, 28 Feb 2015 09:46:29 +0000 (+0200) Subject: tests: Increase bitfield module test coverage X-Git-Tag: hostap_2_4~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56a11801532a28c83fa4855e83c51fbb3a26d8e4;p=thirdparty%2Fhostap.git tests: Increase bitfield module test coverage Signed-off-by: Jouni Malinen --- diff --git a/src/utils/utils_module_tests.c b/src/utils/utils_module_tests.c index 4227bf488..b104585c3 100644 --- a/src/utils/utils_module_tests.c +++ b/src/utils/utils_module_tests.c @@ -168,6 +168,17 @@ static int bitfield_tests(void) 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) { wpa_printf(MSG_ERROR, "%d bitfield test(s) failed", errors); return -1;