void ExceptionTest::unexpected_except()
{
  std::unexpected_handler hdl = &unexpected_hdl;
  std::set_unexpected(hdl);

  try {
    throw_except_func();
  }
  catch (std::bad_exception const&) {
    CPPUNIT_ASSERT( true );
  }
  catch (special_except) {
    CPPUNIT_ASSERT( false );
  }
  CPPUNIT_ASSERT( g_unexpected_called );
}
Beispiel #2
0
void ExceptionTest::unexpected_except()
{
#if !defined (STLPORT) || !defined (_STLP_NO_UNEXPECTED_EXCEPT_SUPPORT)
  std::unexpected_handler hdl = &unexpected_hdl;
  std::set_unexpected(hdl);

  try {
    throw_except_func();
  }
  catch (std::bad_exception const&) {
    CPPUNIT_ASSERT( true );
  }
  catch (special_except) {
    CPPUNIT_ASSERT( false );
  }
  CPPUNIT_ASSERT( g_unexpected_called );
#endif
}