这篇教程C++ test_exception函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中test_exception函数的典型用法代码示例。如果您正苦于以下问题:C++ test_exception函数的具体用法?C++ test_exception怎么用?C++ test_exception使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了test_exception函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: test_add_tuplevoidtest_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); } }
开发者ID:coxlab,项目名称:boost_patched_for_objcplusplus,代码行数:55,
示例2: mainint 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;}
开发者ID:DynamoRIO,项目名称:drmemory,代码行数:26,
示例3: TESTTEST(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");}
开发者ID:PerryZh,项目名称:stan,代码行数:7,
示例4: throw_unknown_exceptionvoidthrow_unknown_exception() { struct test_exception: std::exception { }; throw test_exception(); }
开发者ID:Alexander--,项目名称:Wesnoth-1.8-for-Android,代码行数:10,
示例5: exception_initvoid 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");}
开发者ID:RafaelRMachado,项目名称:Coreboot,代码行数:11,
示例6: mainint 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();}
开发者ID:kaaustubh,项目名称:pjsip,代码行数:13,
示例7: mainint 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;}
开发者ID:eseidel,项目名称:native_client_patches,代码行数:14,
示例8: exception_initvoid 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"); }}
开发者ID:AdriDlu,项目名称:coreboot,代码行数:14,
示例9: operator 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(); } }
开发者ID:HeliumProject,项目名称:ThreadBuildingBlocks,代码行数:14,
示例10: switch //@@{__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; } }
开发者ID:RemedyIT,项目名称:ciaox11,代码行数:19,
示例11: read_all 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 (); }
开发者ID:INMarkus,项目名称:ATCD,代码行数:18,
示例12: mainintmain() { 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(); }
开发者ID:coxlab,项目名称:boost_patched_for_objcplusplus,代码行数:20,
示例13: test_lifetimevoidtest_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); }
开发者ID:coxlab,项目名称:boost_patched_for_objcplusplus,代码行数:22,
示例14: start_mainvoid 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. */}
开发者ID:AdriDlu,项目名称:coreboot,代码行数:36,
注:本文中的test_exception函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ test_fail函数代码示例 C++ test_emit_token函数代码示例 |