4 #ifndef mozilla_algorithm_h
5 # error "failed to wrap <algorithm>"
9 #ifndef mozilla_vector_h
10 # error "failed to wrap <vector>"
13 // gcc errors out if we |try ... catch| with -fno-exceptions, but we
14 // can still test on windows
16 // C4530 will be generated whenever try...catch is used without
17 // enabling exceptions. We know we don't enbale exceptions.
18 # pragma warning(disable : 4530)
20 # define CATCH(e) catch (e)
23 # define CATCH(e) if (0)
26 #include "gtest/gtest.h"
28 #include "mozilla/gtest/MozHelpers.h"
33 mozilla::gtest::DisableCrashReporter();
38 // v.at(1) on empty v should abort; NOT throw an exception
42 CATCH(const std::out_of_range
&) {
43 fputs("TEST-FAIL | TestSTLWrappers.cpp | caught an exception?\n", stderr
);
47 fputs("TEST-FAIL | TestSTLWrappers.cpp | didn't abort()?\n", stderr
);
50 #if defined(XP_WIN) || (defined(XP_MACOSX) && !defined(MOZ_DEBUG))
51 TEST(STLWrapper
, DISABLED_ShouldAbortDeathTest
)
53 TEST(STLWrapper
, ShouldAbortDeathTest
)
56 ASSERT_DEATH_IF_SUPPORTED(ShouldAbort(),
58 // Only libstdc++ will print this message.
59 "terminate called after throwing an instance of "
60 "'std::out_of_range'|vector::_M_range_check"