summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2009-10-13 09:45:16 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2009-10-13 09:45:16 +0000
commit3722da5acfc996a128dfe2c074d46abb83bbe5de (patch)
tree0f3cf7f7f0bd36460595abcd51b687bfc2f0614b
parenta74d73de9467653e7d8ab86459ff759db9edda46 (diff)
downloadATCD-3722da5acfc996a128dfe2c074d46abb83bbe5de.tar.gz
Tue Oct 13 09:44:48 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/INET_Addr_Test.cpp: Extended this test to for is_multicast. This fails on little endian machines at this moment. Thanks to <pr2345 at gmail dot com> for extending this test. This is related to bugzilla 3729
-rw-r--r--ACE/ChangeLog7
-rw-r--r--ACE/tests/INET_Addr_Test.cpp33
2 files changed, 40 insertions, 0 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index b201fe8f013..a7cb8801948 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,10 @@
+Tue Oct 13 09:44:48 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tests/INET_Addr_Test.cpp:
+ Extended this test to for is_multicast. This fails on little endian
+ machines at this moment. Thanks to <pr2345 at gmail dot com> for
+ extending this test. This is related to bugzilla 3729
+
Tue Oct 13 09:33:48 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/OS_Test.cpp:
diff --git a/ACE/tests/INET_Addr_Test.cpp b/ACE/tests/INET_Addr_Test.cpp
index 3ffd482451e..2f29c6c73c5 100644
--- a/ACE/tests/INET_Addr_Test.cpp
+++ b/ACE/tests/INET_Addr_Test.cpp
@@ -60,6 +60,12 @@ struct Address {
bool loopback;
};
+struct Multicast_Address
+{
+ const char *addr_;
+ bool is_multicast_;
+};
+
int run_main (int argc, ACE_TCHAR *argv[])
{
ACE_UNUSED_ARG (argc);
@@ -259,6 +265,33 @@ int run_main (int argc, ACE_TCHAR *argv[])
status = 1;
}
+ // Test is_multicast()
+ Multicast_Address mcast_addresses[] =
+ {
+ { "223.0.0.5:23006", false },
+ { "224.0.0.0:23006", true },
+ { "224.0.0.1:23006", true },
+ { "239.255.255.255:23006", true },
+ { "240.0.0.0:23006", false },
+ { "2.0.0.224", false },
+ { 0, false }
+ };
+
+ for (int i = 0; mcast_addresses[i].addr_; ++i)
+ {
+ ACE_INET_Addr addr (mcast_addresses[i].addr_);
+
+ if (addr.is_multicast () != mcast_addresses[i].is_multicast_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ACE_INET_Addr::is_multicast() for ")
+ ACE_TEXT ("\"%C\" incorrectly returned %d\n"),
+ mcast_addresses[i].addr_,
+ (int)addr.is_multicast ()));
+ status = 1;
+ }
+ }
+
ACE_END_TEST;
return status;