VC源码,开源测试工具.有助于VC++的学习与开发

源代码在线查看: fail.cpp

软件大小: 115 K
上传用户: caim3587
关键词: VC 源码 开源 测试工具
下载地址: 免注册下载 普通下载 VIP

相关代码

				#include 				#include 				#include 								using std::string;				using std::runtime_error;								namespace tut				{				    				/**				 * Testing fail() method.				 */				struct fail_test				{				};								typedef test_group tf;				typedef tf::object object;				tf fail_test("fail()");								template				template				void object::test()				{				    set_test_name("checks fail with message");				    				    try				    {				        fail("A Fail");				        throw runtime_error("fail doesn't work");				    }				    catch (const failure& ex)				    {				        if (string(ex.what()).find("A Fail") == string::npos )				        {				            throw runtime_error("fail doesn't contain proper message");				        }				    }				}								template				template				void object::test()				{				    set_test_name("checks fail without message");				    				    try				    {				        fail();				        throw runtime_error("fail doesn't work");				    }				    catch (const failure&)				    {				    }				}								}											

相关资源