summaryrefslogtreecommitdiff
path: root/ACE/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/tests')
-rw-r--r--ACE/tests/OS_Test.cpp4
-rw-r--r--ACE/tests/test_config.h39
2 files changed, 27 insertions, 16 deletions
diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp
index bf1101c1c77..65115e9b27b 100644
--- a/ACE/tests/OS_Test.cpp
+++ b/ACE/tests/OS_Test.cpp
@@ -548,6 +548,9 @@ string_emulation_test (void)
// ========================================================================
// Test strtok (wchar_t version)
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing strtok (wchar_t version)\n")));
+# ifdef ACE_LACKS_WCSTOK
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Skipped because platform lacks wcstok\n")));
+# else
//FUZZ: enable check_for_lack_ACE_OS
wchar_t strtok_r1[] = ACE_TEXT_WIDE ("A string of tokens");
@@ -565,6 +568,7 @@ string_emulation_test (void)
ACE_TEXT_WIDE (" ")),
ACE_TEXT_WIDE ("tokens") ) == 0);
THIS_IS_NOT_AN_ASSERT_IT_IS_A_NON_DEBUG_TEST_AS_WELL (ACE_OS::strtok (0, ACE_TEXT_WIDE (" ")) == 0);
+# endif /* ACE_LACKS_WCSTOK */
}
diff --git a/ACE/tests/test_config.h b/ACE/tests/test_config.h
index 1d1feaa3547..e606f048a21 100644
--- a/ACE/tests/test_config.h
+++ b/ACE/tests/test_config.h
@@ -88,36 +88,43 @@ size_t const ACE_MAX_THREADS = 4;
#endif /* ACE_END_TEST */
#endif /* ACE_HAS_CONSOLE_TEST_OUTPUT */
-#ifndef ACE_START_TEST
-#define ACE_START_TEST(NAME) \
+#ifdef ACE_TEST_LOG_TO_STDERR
+# define ACE_TEST_LOG_MSG_FLAGS ACE_Log_Msg::STDERR | ACE_Log_Msg::VERBOSE_LITE
+# define ACE_TEST_SET_OUTPUT(APPEND)
+# define ACE_CLOSE_TEST_LOG
+#else
+# define ACE_TEST_LOG_MSG_FLAGS ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE
+# define ACE_TEST_SET_OUTPUT(APPEND) \
+ if (ace_file_stream::instance ()->set_output (program, APPEND) != 0) \
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1);
+# define ACE_CLOSE_TEST_LOG ace_file_stream::instance ()->close ()
+#endif
+
+#define ACE_START_TEST_TEMPLATE(NAME, APPEND) \
const ACE_TCHAR *program = NAME; \
- if (ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE) != 0) \
+ if (ACE_LOG_MSG->open (program, ACE_TEST_LOG_MSG_FLAGS) != 0) \
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open log_msg failed")), -1); \
- if (ace_file_stream::instance()->set_output (program) != 0) \
- ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \
+ ACE_TEST_SET_OUTPUT (APPEND); \
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program))
+
+#ifndef ACE_START_TEST
+# define ACE_START_TEST(NAME) ACE_START_TEST_TEMPLATE (NAME, 0)
#endif /* ACE_START_TEST */
#ifndef ACE_END_TEST
#define ACE_END_TEST \
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %D\n"), program)); \
- ace_file_stream::instance()->close ()
+ ACE_CLOSE_TEST_LOG;
#endif /* ACE_END_TEST */
-#define ACE_CLOSE_TEST_LOG ace_file_stream::instance()->close ()
-
-#define ACE_APPEND_LOG(NAME) \
- const ACE_TCHAR *program = NAME; \
- if (ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE) != 0) \
- ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open log_msg failed")), -1); \
- if (ace_file_stream::instance()->set_output (program, 1) != 0) \
- ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program));
+#ifndef ACE_APPEND_LOG
+# define ACE_APPEND_LOG(NAME) ACE_START_TEST_TEMPLATE (NAME, 1)
+#endif /* ACE_APPEND_LOG */
#define ACE_END_LOG \
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %D\n\n"), program)); \
ACE_LOG_MSG->set_flags(ACE_Log_Msg::SILENT); \
- ace_file_stream::instance()->close ();
+ ACE_CLOSE_TEST_LOG;
#if defined (ACE_VXWORKS)
// This is the only way I could figure out to avoid an error