Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / tests / Bug_3729_Regression_Test.cpp
blob4c0e4fa6928646a757f25235da44cfa2fbbae97d
2 //=============================================================================
3 /**
4 * @file Bug_3729_Regression_Test.cpp
5 */
6 //=============================================================================
9 #include "test_config.h"
10 #include "ace/OS_NS_string.h"
11 #include "ace/INET_Addr.h"
12 #include "ace/Log_Msg.h"
14 struct Multicast_Address
16 const char *addr_;
17 bool is_multicast_;
20 int run_main (int, ACE_TCHAR *[])
22 ACE_START_TEST (ACE_TEXT ("Bug_3729_Regression_Test"));
24 int status = 0; // Innocent until proven guilty
26 // Test is_multicast()
27 Multicast_Address mcast_addresses[] =
29 { "223.0.0.5:23006", false },
30 { "224.0.0.0:23006", true },
31 { "224.0.0.1:23006", true },
32 { "239.255.255.255:23006", true },
33 { "240.0.0.0:23006", false },
34 { "2.0.0.224", false },
35 { 0, false }
38 for (int i = 0; mcast_addresses[i].addr_; ++i)
40 ACE_INET_Addr addr (mcast_addresses[i].addr_);
42 if (addr.is_multicast () != mcast_addresses[i].is_multicast_)
44 ACE_ERROR ((LM_ERROR,
45 ACE_TEXT ("ACE_INET_Addr::is_multicast() for ")
46 ACE_TEXT ("\"%C\" incorrectly returned %d\n"),
47 mcast_addresses[i].addr_,
48 (int)addr.is_multicast ()));
49 status = 1;
53 ACE_END_TEST;
55 return status;