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_pin_is_checksum_valid
This commit is contained in:
parent
94c49a4563
commit
40013e9981
@ -2178,6 +2178,13 @@ static void wsc_test_pin_valid(const void *data)
|
|||||||
assert(!wsc_pin_is_valid("abcdefgh"));
|
assert(!wsc_pin_is_valid("abcdefgh"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void wsc_test_pin_checksum(const void *data)
|
||||||
|
{
|
||||||
|
assert(!wsc_pin_is_checksum_valid("12345671"));
|
||||||
|
assert(wsc_pin_is_checksum_valid("12345670"));
|
||||||
|
assert(wsc_pin_is_checksum_valid("24681353"));
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
l_test_init(&argc, &argv);
|
l_test_init(&argc, &argv);
|
||||||
@ -2265,6 +2272,7 @@ int main(int argc, char *argv[])
|
|||||||
wsc_test_retransmission_no_fragmentation, NULL);
|
wsc_test_retransmission_no_fragmentation, NULL);
|
||||||
|
|
||||||
l_test_add("/wsc/pin/valid pin", wsc_test_pin_valid, NULL);
|
l_test_add("/wsc/pin/valid pin", wsc_test_pin_valid, NULL);
|
||||||
|
l_test_add("/wsc/pin/valid checksum", wsc_test_pin_checksum, NULL);
|
||||||
|
|
||||||
return l_test_run();
|
return l_test_run();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user