void test_add_tuple() { typedef boost::tuple<test_1,test_2> test_12; typedef boost::tuple<test_1,test_2,test_3> test_123; typedef boost::tuple<test_1,test_2,test_3,test_5> test_1235; try { throw test_exception() << test_12(42,42u); } catch( test_exception & x ) { BOOST_TEST( *boost::get_error_info<test_1>(x)==42 ); BOOST_TEST( *boost::get_error_info<test_2>(x)==42u ); } catch( ... ) { BOOST_TEST(false); } try { throw test_exception() << test_123(42,42u,42.0f); } catch( test_exception & x ) { BOOST_TEST( *boost::get_error_info<test_1>(x)==42 ); BOOST_TEST( *boost::get_error_info<test_2>(x)==42u ); BOOST_TEST( *boost::get_error_info<test_3>(x)==42.0f ); } catch( ... ) { BOOST_TEST(false); } try { throw test_exception() << test_1235(42,42u,42.0f,std::string("42")); } catch( test_exception & x ) { BOOST_TEST( *boost::get_error_info<test_1>(x)==42 ); BOOST_TEST( *boost::get_error_info<test_2>(x)==42u ); BOOST_TEST( *boost::get_error_info<test_3>(x)==42.0f ); BOOST_TEST( *boost::get_error_info<test_5>(x)=="42" ); } catch( ... ) { BOOST_TEST(false); } }
int main() { #ifdef UNIX intercept_signal(SIGSEGV, signal_handler); #else SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER) our_top_handler); #endif test_leaks(); test_basic(); test_exception(); test_mismatch_dtr(); test_mismatch_int(); std::cout << "bye" << std::endl; /* mismatches above end up causing RtlpCoalesceFreeBlocks to crash resulting * in failing app exit code: simpler to just exit */ exit(0); return 0; }
TEST(ioJson,jsonParserErr08) { std::stringstream ss; char c = 11; ss << "[ \"" << c << "\" ]"; test_exception(ss.str(), "found control character, char values less than U+0020 must be \\u escaped\n"); }
void throw_unknown_exception() { struct test_exception: std::exception { }; throw test_exception(); }
void exception_init(void) { /* Load the exception table. */ exception_hwinit(); printk(BIOS_DEBUG, "ARM64: Exception handlers installed.\n"); printk(BIOS_DEBUG, "ARM64: Testing exception\n"); test_exception(); printk(BIOS_DEBUG, "ARM64: Done test exception\n"); }
int main() { pj_status_t rc; // Error handling is omited for clarity. rc = pj_init(); rc = pj_exception_id_alloc("No Memory", &NO_MEMORY); rc = pj_exception_id_alloc("Other Exception", &OTHER_EXCEPTION); return test_exception(); }
int main(int ac, char* av[]) { int errs = 0; errs += test_constants(); errs += test_compares(); errs += test_defined(); errs += test_errs(); #if !defined(NO_ERRNO_CHECK) errs += test_exception(); #endif printf("%d errs!\n", errs); return errs + 55; }
void exception_init(void) { /* Load the exception table and initialize SP_EL3. */ exception_init_asm(exception_stack + ARRAY_SIZE(exception_stack)); printk(BIOS_DEBUG, "ARM64: Exception handlers installed.\n"); /* Only spend time testing on debug builds that are trying to detect more errors. */ if (IS_ENABLED(CONFIG_FATAL_ASSERTS)) { printk(BIOS_DEBUG, "ARM64: Testing exception\n"); test_exception(); printk(BIOS_DEBUG, "ARM64: Done test exception\n"); } }
void operator() () const { Harness::ConcurrencyTracker ct; AssertLive(); if ( g_Throw ) { if ( ++m_TaskCount == SKIP_CHORES ) __TBB_THROW( test_exception(EXCEPTION_DESCR1) ); __TBB_Yield(); } else { ++g_TaskCount; while( !Concurrency::is_current_task_group_canceling() ) __TBB_Yield(); } }
//@@{__RIDL_REGEN_MARKER__} - BEGIN : CIAO_UnkeyedWriterTest_Sender_Impl::Sender_exec_i[src_user_public_ops] void Sender_exec_i::tick () { switch (this->assignment_) { case WRITER_ASSIGNMENT::WRITE_UNKEYED: write_unkeyed (); break; case WRITER_ASSIGNMENT::WRITE_MULTI: write_many (); break; case WRITER_ASSIGNMENT::TEST_EXCEPTION: test_exception (); break; default: break; } }
void Receiver_exec_i::run () { this->reactor ()->cancel_timer (this->ticker_); delete this->ticker_; this->ticker_ = 0; this->has_run_ = true; read_all (); read_last (); read_one_all (); read_one_last (); test_exception (); //now test with collected handles read_one_all (true); read_one_last (true); test_exception_with_handles (); }
int main() { boost::exception_ptr p = boost::copy_exception(test_exception()); try { rethrow_exception(p); BOOST_TEST(false); } catch( test_exception & ) { } catch( ... ) { BOOST_TEST(false); } return boost::report_errors(); }
void test_lifetime() { int count=0; try { throw test_exception() << test_7(user_data(count)); BOOST_TEST(false); } catch( boost::exception & x ) { BOOST_TEST(count==1); BOOST_TEST( boost::get_error_info<test_7>(x) ); } catch( ... ) { BOOST_TEST(false); } BOOST_TEST(!count); }
void start_main(void) { extern int main(int argc, char **argv); pre_sysinfo_scan_mmu_setup(); /* Gather system information. */ lib_get_sysinfo(); post_sysinfo_scan_mmu_setup(); #if !IS_ENABLED(CONFIG_LP_SKIP_CONSOLE_INIT) console_init(); #endif printf("ARM64: Libpayload %s\n",__func__); exception_init(); test_exception(); /* * Any other system init that has to happen before the * user gets control goes here. */ /* * Go to the entry point. * In the future we may care about the return value. */ (void) main(main_argc, (main_argc != 0) ? main_argv : NULL); /* * Returning here will go to the _leave function to return * us to the original context. */ }
TEST(ioJson,jsonParserErr12e) { test_exception("{ \"a\" : [ 5 ] ] }", "expecting end of object } or separator ,\n"); }
TEST(ioJson,jsonParserErr19d) { test_exception("[ 9.19191919191919e1000000000000 ]", "number exceeds double range\n"); }
TEST(ioJson,jsonParserErr12) { test_exception("[5}", "in array, expecting ] or ,\n"); }
TEST(ioJson,jsonParserErr19b) { test_exception("[ -1111111111111111111111111111 ]", "number exceeds integer range\n"); }
TEST(ioJson,jsonParserErr19c) { test_exception("[ 9.9999999e-1000000000000 ]", "number exceeds double range\n"); }
TEST(ioJson,jsonParserErr17) { test_exception("{ \"5\" : ", "unexpected end of stream\n"); }
TEST(ioJson,jsonParserErr18) { test_exception("[ -1, -2, \"-inf\", ]", "in array, expecting value\n"); }
TEST(ioJson,jsonParserErr15) { test_exception("{ \"5\" 5 }", "expecting key-value separator :\n"); }
TEST(ioJson,jsonParserErr16) { test_exception("{ \"5\" : 5 \"6\" : 6 }", "expecting end of object } or separator ,\n"); }
TEST(ioJson,jsonParseErr14e) { test_exception("{ \"foo\" : [ { \"bar\": { \"baz\": [ 1, 2] } }, -3, -4.44 } } } ] } ", "in array, expecting ] or ,\n"); }
TEST(ioJson,jsonParserErr14f) { test_exception("{ \"foo\": -1.0100e09 , ", "unexpected end of stream\n"); }
TEST(ioJson,jsonParserErr14c) { test_exception("{ \"bar\" : [ \"foo\": -1.0100e09 , }", "in array, expecting ] or ,\n"); }
TEST(ioJson,jsonParserErr14b) { test_exception("{ \"bar\" : { \"foo\": -1.0100e09 , }", "expecting member key or end of object marker (})\n"); }
TEST(ioJson,jsonParserErr13) { test_exception("{ hello }", "expecting member key or end of object marker (})\n"); }
TEST(ioJson,jsonParserErr12b) { test_exception("[ \"a\", a ]", "illegal value, expecting object, array, number, string, or literal true/false/null\n"); }
TEST(ioJson,jsonParserErr12c) { test_exception("[ \"a\", ", "unexpected end of stream\n"); }