hrev54023 adds 1 changeset to branch 'master'
old head: 61557c8240ab243979ec1cc6ad1667ac85be8628
new head: 40aa43588d31e301eefbf5ce6f0d3f55b32c8aad
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=40aa43588d31+%5E61557c8240ab
----------------------------------------------------------------------------
40aa43588d31: tests/net: Fix NetworkAddressTest::TestUnset()
This test just checks a default-constructed BNetworkAddress and a
BNetworkAddress that has had its Unset method invoked are in the same
state.
It also compares against a BNetworkAddress that has been constructed
with the AF_INET family. In BeOS R5 this worked because you could
construct a BNetworkAddress with nullptr for the host parameter, but
in Haiku this this leads to Unset() being invoked. So
BNetworkAddress(AF_INET, NULL) is the same as a default-constructed
BNetworkAddress object.
This patch just changes the test to construct the BNetworkAddress used
for comparison with a valid host using the IPv4 loopback address
instead.
Change-Id: Id890110cfa1f3c40a630f9005e2a390e25f6baae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2388
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
[ Kyle Ambroff-Kao <kyle@xxxxxxxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev54023
Commit: 40aa43588d31e301eefbf5ce6f0d3f55b32c8aad
URL: https://git.haiku-os.org/haiku/commit/?id=40aa43588d31
Author: Kyle Ambroff-Kao <kyle@xxxxxxxxxxxxxx>
Date: Sun Mar 22 00:42:07 2020 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Apr 4 22:44:37 2020 UTC
----------------------------------------------------------------------------
1 file changed, 3 insertions(+), 1 deletion(-)
src/tests/kits/net/libnetapi/NetworkAddressTest.cpp | 4 +++-
----------------------------------------------------------------------------
diff --git a/src/tests/kits/net/libnetapi/NetworkAddressTest.cpp
b/src/tests/kits/net/libnetapi/NetworkAddressTest.cpp
index 8f2bf56226..649796428d 100644
--- a/src/tests/kits/net/libnetapi/NetworkAddressTest.cpp
+++ b/src/tests/kits/net/libnetapi/NetworkAddressTest.cpp
@@ -31,10 +31,12 @@ NetworkAddressTest::TestUnset()
{
BNetworkAddress unset;
+ CPPUNIT_ASSERT(unset.InitCheck() == B_OK);
CPPUNIT_ASSERT(unset.Family() == AF_UNSPEC);
CPPUNIT_ASSERT(unset.Port() == 0);
- BNetworkAddress set(AF_INET, NULL);
+ BNetworkAddress set(AF_INET, "127.0.0.1");
+ CPPUNIT_ASSERT(set.InitCheck() == B_OK);
CPPUNIT_ASSERT(set.Family() == AF_INET);
CPPUNIT_ASSERT(unset != set);