diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2025-10-20 18:31:41 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2025-10-20 18:31:41 +0000 |
| commit | e1aeb58cbbc3839db93ec38ce491b7b9383d5649 (patch) | |
| tree | b9459cb442be4586a59bee3dddadc7441cf35a41 | |
| parent | a8e4399fc6a27b4f8ab828231ede75743ba28a58 (diff) | |
inet_net_test: Use int to hold expected return values from inet_net_pton
GCC warns about the sign mismatch in comparisons:
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_inet4::body() const':
lib/libc/tests/net/inet_net_test.cc:86:17: error: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Werror=sign-compare]
86 | ATF_REQUIRE_EQ(bits, addr.bits);
| ^~~~~~~~~~~~~~
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_inet6::body() const':
lib/libc/tests/net/inet_net_test.cc:205:17: error: comparison of integer expressions of different signedness: 'int' and 'const unsigned int' [-Werror=sign-compare]
205 | ATF_REQUIRE_EQ(bits, addr.bits);
| ^~~~~~~~~~~~~~
Fixes: 8f4a0d2f7b96 ("libc: Import OpenBSD's inet_net_{ntop,pton}")
| -rw-r--r-- | lib/libc/tests/net/inet_net_test.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/tests/net/inet_net_test.cc b/lib/libc/tests/net/inet_net_test.cc index 4ecf5a3de492..c4411373165e 100644 --- a/lib/libc/tests/net/inet_net_test.cc +++ b/lib/libc/tests/net/inet_net_test.cc @@ -50,7 +50,7 @@ ATF_TEST_CASE_BODY(inet_net_inet4) struct test_addr { std::string input; - unsigned bits; + int bits; std::string output; }; @@ -134,7 +134,7 @@ ATF_TEST_CASE_BODY(inet_net_inet6) struct test_addr { std::string input; - unsigned bits; + int bits; std::string output; }; |
