YSTest: test.cpp 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

test.cpp
浏览该文件的文档.
1 /*
2 © 2014 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #include "ytest/test.h"
29
30 namespace ytest
31 {
32
33 group_guard::group_guard(const std::string& name)
34 : subject(name)
35 {}
36 group_guard::group_guard(const std::string& name, std::function<void(
37 group_guard&)> on_b, std::function<void(group_guard&)> on_e)
38 : subject(name), on_end(on_e)
39 {
40 if(on_b)
41 on_b(*this);
42 }
43 group_guard::~group_guard()
44 {
45 try
46 {
47 on_end(*this);
48 }
49 catch(...)
50 {}
51 }
52
53 } // namespace ytest;
54
ytest::group_guard
测试组 RAII 辅助对象。
Definition: test.h:65
platform::containers::string
basic_string< char > string
Definition: Container.h:101
NPL::A1::name
ctx const string & name
Definition: NPLA1.h:248
ytest::group_guard::~group_guard
~group_guard()
析构：调用 on_end 。
Definition: test.cpp:43
ytest::group_guard::group_guard
group_guard(const std::string &)
构造：提供名称。
Definition: test.cpp:33
ytest
YFramework 基础测试库命名空间。
Definition: test.h:44
test.h
基础测试工具。
ytest::group_guard::on_end
std::function< void(group_guard &)> on_end
Definition: test.h:71