You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2007/12/14 03:33:05 UTC

svn commit: r604088 - /incubator/stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp

Author: sebor
Date: Thu Dec 13 18:33:01 2007
New Revision: 604088

URL: http://svn.apache.org/viewvc?rev=604088&view=rev
Log:
2007-12-13 Travis Vitek <vi...@roguewave.com>

	STDCXX-664
	* tests/localization/22.locale.globals.mt.cpp (run_test):
	Avoid testing that use_facet<>() throws when using byname
	facets when _RWSTD_NO_DYNAMIC_CAST is defined.

2007-12-13  Martin Sebor  <se...@roguewave.com>

	* tests/localization/22.locale.globals.mt.cpp (use_facet_loop):
	Removed preprocessor guards for _RWSTD_NO_THREAD_SAFE_EXCEPTIONS.
	(run_test): Set opt_no_exceptions in response to the above macro
	for consistency with Travis' solution in the change above.

Modified:
    incubator/stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp

Modified: incubator/stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp?rev=604088&r1=604087&r2=604088&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp (original)
+++ incubator/stdcxx/trunk/tests/localization/22.locale.globals.mt.cpp Thu Dec 13 18:33:01 2007
@@ -295,8 +295,6 @@
         }
         else if (0 == opt_no_exceptions) {
 
-#if 1 // def _RWSTD_NO_THREAD_SAFE_EXCEPTIONS
-
             bool threw;
 
 #define TEST_USE_FACET(Facet, opt)                              \
@@ -317,9 +315,6 @@
             TEST_USE_FACET (NumpunctByname, numpunct);
             TEST_USE_FACET (TimeGetByname, time_get);
             TEST_USE_FACET (TimePutByname, time_put);
-
-#endif   // _RWSTD_NO_THREAD_SAFE_EXCEPTIONS
-
         }
     }
 
@@ -373,8 +368,6 @@
         }
         else if (0 == opt_no_exceptions) {
 
-#ifndef _RWSTD_NO_THREAD_SAFE_EXCEPTIONS
-
             bool threw;
 
             TEST_USE_FACET (WCollateByname, collate);
@@ -386,9 +379,6 @@
             TEST_USE_FACET (WNumpunctByname, numpunct);
             TEST_USE_FACET (WTimeGetByname, time_get);
             TEST_USE_FACET (WTimePutByname, time_put);
-
-#endif   // _RWSTD_NO_THREAD_SAFE_EXCEPTIONS
-
         }
     }
 
@@ -534,10 +524,30 @@
         rw_info (0, 0, 0,
                  "template <class T> const T& std::use_facet (const locale&)");
 
+#ifdef _RWSTD_NO_DYNAMIC_CAST
+
+        // if dynamic_cast isn't supported, then [has,use]_facet()
+        // can't reliably detect if a facet is installed or not.
+        rw_warn (0 != opt_no_exceptions, 0, __LINE__,
+                 "dynamic_cast not supported "
+                 "(macro _RWSTD_NO_DYNAMIC_CAST is #defined), "
+                 "disabling exceptions tests");
+
+        opt_no_exceptions = 1;
+
+#endif   // _RWSTD_NO_DYNAMIC_CAST
+
+
 #ifdef _RWSTD_NO_THREAD_SAFE_EXCEPTIONS
 
+        // avoid exercising exceptions (triggered by use_facet) if
+        // their implementation in the runtime isn't thread-safe
         rw_warn (0, 0, 0,
-                 "exceptions not thread safe, skipping that part of test");
+                 "exceptions not thread safe (macro "
+                 "_RWSTD_NO_THREAD_SAFE_EXCEPTIONS is #defined), "
+                 "disabling exceptions tests");
+
+        opt_no_exceptions = 1;
 
 #endif   // _RWSTD_NO_THREAD_SAFE_EXCEPTIONS