diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2012-05-18 22:05:37 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2012-05-18 22:05:37 +0000 |
| commit | 6d7405089db8359d001b3f9133e819f8d40c0a8a (patch) | |
| tree | db5bc84749f808afce94d640ed04bf00be26952f /qpid/cpp/src/tests | |
| parent | d09c5fd0d1c027bba41db30f8648fd8a024f9633 (diff) | |
| download | qpid-python-6d7405089db8359d001b3f9133e819f8d40c0a8a.tar.gz | |
QPID-4011: TestIsLocalHost unit_test fails with if machine name resolves to loopback address
QPID-3404 - This change also adds support for IPv6 interface addresses to getLocalIpAddresses
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1340279 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
| -rw-r--r-- | qpid/cpp/src/tests/SystemInfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/SystemInfo.cpp b/qpid/cpp/src/tests/SystemInfo.cpp index c467a0b012..12d8d3dba8 100644 --- a/qpid/cpp/src/tests/SystemInfo.cpp +++ b/qpid/cpp/src/tests/SystemInfo.cpp @@ -37,12 +37,14 @@ QPID_AUTO_TEST_CASE(TestIsLocalHost) { BOOST_ASSERT(SystemInfo::getLocalHostname(a)); BOOST_ASSERT(SystemInfo::isLocalHost(a.host)); std::vector<Address> addrs; + SystemInfo::getLocalIpAddresses(0, addrs); for (std::vector<Address>::iterator i = addrs.begin(); i != addrs.end(); ++i) BOOST_ASSERT(SystemInfo::isLocalHost(i->host)); // Check some non-local addresses BOOST_ASSERT(!SystemInfo::isLocalHost("123.4.5.6")); BOOST_ASSERT(!SystemInfo::isLocalHost("nosuchhost")); BOOST_ASSERT(SystemInfo::isLocalHost("127.0.0.1")); + BOOST_ASSERT(SystemInfo::isLocalHost("::1")); } QPID_AUTO_TEST_SUITE_END() |
