summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2010-06-17 19:08:21 +0000
committerSteve Huston <shuston@riverace.com>2010-06-17 19:08:21 +0000
commitf4806876ddb83cf5403f40d8268778ef2ed073c7 (patch)
treee0899f7b610b17affe3e20278316bed91bdb937a
parentf24f1a8da7b73204d1460dde2a2b3b0b82311ad5 (diff)
downloadATCD-f4806876ddb83cf5403f40d8268778ef2ed073c7.tar.gz
ChangeLogTag:Thu Jun 17 19:01:32 UTC 2010 Steve Huston <shuston@riverace.com>
-rw-r--r--ACE/ChangeLog8
-rw-r--r--ACE/tests/Service_Config_Test.cpp44
2 files changed, 52 insertions, 0 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index ed1cae18e91..073b7fcc71d 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,11 @@
+Thu Jun 17 19:01:32 UTC 2010 Steve Huston <shuston@riverace.com>
+
+ * tests/Service_Config_Test.cpp: Added a new test case,
+ testUnloadingACELoggingStrategy. It loads then unloads the
+ ACE logging strategy. This causes ACE to run down itself,
+ smashing singletons in the process. This test case goes with
+ Bugzilla #3856.
+
Wed Jun 16 21:48:49 UTC 2010 Adam Mitz <mitza@ociweb.com>
* bin/MakeProjectCreator/config/acedefaults.mpb:
diff --git a/ACE/tests/Service_Config_Test.cpp b/ACE/tests/Service_Config_Test.cpp
index 10f02350d29..0460d2a15eb 100644
--- a/ACE/tests/Service_Config_Test.cpp
+++ b/ACE/tests/Service_Config_Test.cpp
@@ -328,6 +328,49 @@ testLoadingServiceConfFile (int argc, ACE_TCHAR *argv[])
}
+// Loading and unloading the ACE logger service should not smash singletons.
+void
+testUnloadingACELoggingStrategy (int, ACE_TCHAR *[])
+{
+ static const ACE_TCHAR *load_logger =
+#if (ACE_USES_CLASSIC_SVC_CONF == 1)
+ ACE_TEXT ("dynamic Logger Service_Object * ")
+ ACE_TEXT (" ACE:_make_ACE_Logging_Strategy() \"\"")
+#else
+ ACE_TEXT ("<dynamic id=\"Logger\" type=\"Service_Object\">")
+ ACE_TEXT (" <initializer init=\"_make_ACE_Logging_Strategy\" ")
+ ACE_TEXT (" path=\"ACE\" params=\"\"/>")
+ ACE_TEXT ("</dynamic>")
+#endif /* (ACE_USES_CLASSIC_SVC_CONF == 1) */
+ ;
+
+ static const ACE_TCHAR *unload_logger =
+#if (ACE_USES_CLASSIC_SVC_CONF == 1)
+ ACE_TEXT ("remove Logger")
+#else
+ ACE_TEXT ("<remove id=\"Logger\" />");
+#endif /* (ACE_USES_CLASSIC_SVC_CONF == 1) */
+ ;
+
+ ACE_Reactor *r1 = ACE_Reactor::instance();
+
+ int error_count = 0;
+ if ((error_count = ACE_Service_Config::process_directive (load_logger)) != 0)
+ {
+ ++error;
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Load ACE Logger should have returned 0; ")
+ ACE_TEXT ("returned %d instead\n"),
+ error_count));
+ }
+ ACE_Service_Config::process_directive (unload_logger);
+
+ ACE_Reactor *r2 = ACE_Reactor::instance ();
+ if (r1 != r2)
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("Reactor before %@, after %@\n"), r1, r2));
+}
+
+
// @brief The size of a repository is unlimited and can be exceeded
void
testLimits (int , ACE_TCHAR *[])
@@ -665,6 +708,7 @@ run_main (int argc, ACE_TCHAR *argv[])
testFailedServiceInit (argc, argv);
testLoadingServiceConfFile (argc, argv);
testLoadingServiceConfFileAndProcessNo (argc, argv);
+ testUnloadingACELoggingStrategy (argc, argv);
testLimits (argc, argv);
testrepository (argc, argv);
#if defined (ACE_HAS_WTHREADS) || defined (ACE_HAS_PTHREADS_STD)