Bug 551254 - remove ENABLE_CXX_EXCEPTIONS from XPCOM tests.
authorJacek Caban <jacek@codeweavers.com>
Fri, 16 Apr 2010 00:29:15 -0500
changeset 40907 6742813074a95c9506a9bdf119a999279c1eae6f
parent 40906 c4a3c240ab5e8a3d363eafa06bf6a5a75d07017e
child 40908 4116478e20022a97885b9eacbbb70e73e28827c6
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs551254
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 551254 - remove ENABLE_CXX_EXCEPTIONS from XPCOM tests.
xpcom/tests/Makefile.in
xpcom/tests/TestCOMPtr.cpp
xpcom/tests/TestSTLWrappers.cpp
--- a/xpcom/tests/Makefile.in
+++ b/xpcom/tests/Makefile.in
@@ -145,18 +145,16 @@ endif
 
 LIBS += $(XPCOM_LIBS)
 
 # Needed to resolve __yylex (?)
 ifeq ($(OS_ARCH)$(OS_RELEASE),FreeBSD2)
 LIBS		+= -lpcap
 endif
 
-ENABLE_CXX_EXCEPTIONS = 1
-
 XPCSHELL_TESTS = unit
 
 # Make sure we have symbols in case we need to debug these.
 MOZ_DEBUG_SYMBOLS = 1
 
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(OS_ARCH),WINCE)
--- a/xpcom/tests/TestCOMPtr.cpp
+++ b/xpcom/tests/TestCOMPtr.cpp
@@ -315,68 +315,16 @@ AVoidPtrPtrContext( void** )
   {
   }
 
 void
 AnISupportsPtrPtrContext( nsISupports** )
 	{
 	}
 
-
-// Optimism
-#define TEST_EXCEPTIONS 1
-
-// HAVE_CPP_EXCEPTIONS is defined automagically on unix
-#if defined(XP_UNIX) || defined(XP_BEOS) || defined(XP_OS2)
-#if !defined(HAVE_CPP_EXCEPTIONS)
-#undef TEST_EXCEPTIONS
-#endif
-#endif
-
-#ifdef TEST_EXCEPTIONS
-static
-nsresult
-TestBloat_Raw()
-	{
-		IBar* barP = 0;
-		nsresult result = CreateIBar(REINTERPRET_CAST(void**, &barP));
-
-		if ( barP )
-			{
-				try
-					{
-						IFoo* fooP = 0;
-						if ( NS_SUCCEEDED( result = barP->QueryInterface(NS_GET_IID(IFoo), REINTERPRET_CAST(void**, &fooP)) ) )
-							{
-								try
-									{
-										fooP->print_totals();
-									}
-								catch( ... )
-									{
-										NS_RELEASE(fooP);
-										throw;
-									}
-
-								NS_RELEASE(fooP);
-							}
-					}
-				catch( ... )
-					{
-						NS_RELEASE(barP);
-						throw;
-					}
-
-				NS_RELEASE(barP);
-			}
-
-		return result;
-	}
-#endif // TEST_EXCEPTIONS
-
 static
 nsresult
 TestBloat_Raw_Unsafe()
 	{
 		IBar* barP = 0;
 		nsresult result = CreateIBar(REINTERPRET_CAST(void**, &barP));
 
 		if ( barP )
@@ -417,19 +365,16 @@ nsCOMPtr<IFoo> gFoop;
 
 int
 main()
   {
     printf(">>main()\n");
 
 		printf("sizeof(nsCOMPtr<IFoo>) --> %d\n", sizeof(nsCOMPtr<IFoo>));
 
-#ifdef TEST_EXCEPTIONS
-		TestBloat_Raw();
-#endif // TEST_EXCEPTIONS
 		TestBloat_Raw_Unsafe();
 		TestBloat_Smart();
 
 
     {
       printf("\n### Test  1: will a |nsCOMPtr| call |AddRef| on a pointer assigned into it?\n");
       nsCOMPtr<IFoo> foop( do_QueryInterface(new IFoo) );
 
--- a/xpcom/tests/TestSTLWrappers.cpp
+++ b/xpcom/tests/TestSTLWrappers.cpp
@@ -7,17 +7,17 @@
 
 #include <vector>
 #ifndef mozilla_vector_h
 #  error "failed to wrap <vector>"
 #endif
 
 // gcc errors out if we |try ... catch| with -fno-exceptions, but we
 // can still test on windows
-#ifdef XP_WIN
+#ifdef _MSC_VER
 #  define TRY       try
 #  define CATCH(e)  catch (e)
 #else
 #  define TRY
 #  define CATCH(e)  if (0)
 #endif
 
 int main() {