diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2017-03-22 19:52:38 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2017-03-22 19:52:38 +0000 |
commit | 983979fa0d124e9920ef2dab548cd089ab9c974c (patch) | |
tree | 7d4417ecc61a58c1063c0f23cab3abe2c1064f8b | |
parent | 33ea4aae378f390aa4e2163389cd2cc183420ebe (diff) | |
download | libgit2-ethomson/3872.tar.gz |
inet_pton: don't assume addr families don't existethomson/3872
Address family 5 might exist on some crazy system like Haiku.
Use `INT_MAX-1` as an unsupported address family.
-rw-r--r-- | tests/core/posix.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/core/posix.c b/tests/core/posix.c index 018d0c8ba..172462073 100644 --- a/tests/core/posix.c +++ b/tests/core/posix.c @@ -94,10 +94,7 @@ void test_core_posix__inet_pton(void) cl_assert(p_inet_pton(AF_INET, "10.foo.bar.1", &addr) == 0); /* Test unsupported address families */ - cl_git_fail(p_inet_pton(12, "52.472", &addr)); /* AF_DECnet */ - cl_assert_equal_i(EAFNOSUPPORT, errno); - - cl_git_fail(p_inet_pton(5, "315.124", &addr)); /* AF_CHAOS */ + cl_git_fail(p_inet_pton(INT_MAX-1, "52.472", &addr)); cl_assert_equal_i(EAFNOSUPPORT, errno); } |