1 #include "test_config.h"
2 #include "ace/OS_NS_string.h"
3 #include "ace/OS_NS_netdb.h"
5 #undef THIS_IS_NOT_AN_ASSERT_IT_IS_A_NON_DEBUG_TEST_AS_WELL
6 #define THIS_IS_NOT_AN_ASSERT_IT_IS_A_NON_DEBUG_TEST_AS_WELL(X) \
8 ? static_cast<void>(0) \
9 : ACE_VERSIONED_NAMESPACE_NAME::__ace_assert(__FILE__, __LINE__, ACE_TEXT_CHAR_TO_TCHAR (#X)))
14 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT ("Testing getmacaddress\n")));
16 #if defined (ACE_LACKS_NETWORKING)
18 #else /* ACE_LACKS_NETWORKING */
19 struct ACE_OS::macaddr_node_t node
;
21 ACE_OS::memset (&node
, 0x0, sizeof (node
));
22 int retval
= ACE_OS::getmacaddress (&node
);
25 if (node
.node
[0] == 0x0 && node
.node
[1] == 0x0 && node
.node
[2] == 0x0 &&
26 node
.node
[3] == 0x0 && node
.node
[4] == 0x0 && node
.node
[5] == 0x0)
29 ACE_TEXT ("ACE_OS::getmacaddress() failed to get MAC address\n")));
36 ACE_TEXT ("ACE_OS::getmacaddress() returned %d, should be 0. %p\n"),
37 retval
, ACE_TEXT ("error:")));
41 ACE_TEXT ("MAC address: %02x:%02x:%02x:%02x:%02x:%02x\n"),
42 node
.node
[0], node
.node
[1], node
.node
[2],
43 node
.node
[3], node
.node
[4], node
.node
[5]));
46 #endif /* ACE_LACKS_NETWORKING */
50 run_main (int, ACE_TCHAR
*[])
52 ACE_START_TEST (ACE_TEXT ("Bug_3744_Regression_Test"));
57 if ((result
= getmacaddress_test ()) != 0)
63 #undef THIS_IS_NOT_AN_ASSERT_IT_IS_A_NON_DEBUG_TEST_AS_WELL