3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-18 17:22:50 +01:00

unit: Add sanity check for wsc_is_pin_valid

This commit is contained in:
Denis Kenzior 2017-02-13 19:37:27 -06:00
parent 89d6b85f1d
commit 11f4ff2e25

View File

@ -2168,6 +2168,15 @@ static void wsc_test_retransmission_no_fragmentation(const void *data)
eapol_exit(); eapol_exit();
} }
static void wsc_test_pin_valid(const void *data)
{
assert(wsc_pin_is_valid("1234"));
assert(wsc_pin_is_valid("12345678"));
assert(!wsc_pin_is_valid(""));
assert(!wsc_pin_is_valid("123456789"));
assert(!wsc_pin_is_valid("abcdefgh"));
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
l_test_init(&argc, &argv); l_test_init(&argc, &argv);
@ -2254,5 +2263,7 @@ int main(int argc, char *argv[])
l_test_add("/wsc/retransmission/no fragmentation", l_test_add("/wsc/retransmission/no fragmentation",
wsc_test_retransmission_no_fragmentation, NULL); wsc_test_retransmission_no_fragmentation, NULL);
l_test_add("/wsc/pin/valid pin", wsc_test_pin_valid, NULL);
return l_test_run(); return l_test_run();
} }