From: Szabolcs Nagy Date: Sat, 19 Oct 2013 23:16:33 +0000 (+0000) Subject: add an inet_pton regression test X-Git-Url: http://nsz.repo.hu/git/?p=libc-test;a=commitdiff_plain;h=67b4c0a6f7eaf8bf85ec2892d7bfb7563db99b42 add an inet_pton regression test --- diff --git a/src/regression/inet_pton-invalid-address.c b/src/regression/inet_pton-invalid-address.c new file mode 100644 index 0000000..7f181f4 --- /dev/null +++ b/src/regression/inet_pton-invalid-address.c @@ -0,0 +1,14 @@ +// inet_pton should return 0 on invalid address format +#include +#include +#include "test.h" + +int main(void) +{ + int r; + char addr[16]; + + if ((r=inet_pton(AF_INET6, "192.168.1.1", addr)) != 0) + t_error("inet_pton(AF_INET6, \"192.168.1.1\", addr) should return 0, got %d\n", r); + return t_status; +}