10 #include "dhcp-protocol.h"
11 #include "dhcp-internal.h"
13 static void test_invalid_buffer_length(void)
17 assert(dhcp_option_parse(&message, 0, NULL, NULL) == -EINVAL);
18 assert(dhcp_option_parse(&message, sizeof(DHCPMessage), NULL, NULL)
22 static void test_cookie(void)
25 size_t len = sizeof(DHCPMessage) + 4;
28 message = malloc0(len);
30 opt = (uint8_t *)(message + 1);
33 assert(dhcp_option_parse(message, len, NULL, NULL) == -EINVAL);
40 assert(dhcp_option_parse(message, len, NULL, NULL) == -ENOMSG);
45 int main(int argc, char *argv[])
47 test_invalid_buffer_length();