【文件属性】:
文件名称:unit_test:C ++的无摩擦单元测试框架
文件大小:7KB
文件格式:ZIP
更新时间:2021-02-19 14:28:52
Python
假设我们要测试以下类Foo。
/*
* Foo.h
* A simple class.
*/
class Foo {
public:
Foo () {};
~Foo () {};
void set ( int x) { this -> value = x; };
int get () { return this -> value ; };
private:
int value;
};
这是Foo的单元测试文件
/*
* Foo_tests.cpp
* unit tests for the Foo class.
*/
# include < cassert>
# include " Foo.h "
void constructor () {
Foo f;
}
void set_test () {
Foo f;
f.
【文件预览】:
unit_test-main
----unit_test(11KB)
----_config.yml(27B)
----README.md(4KB)
----example()
--------Foo.h(252B)
--------Makefile(436B)
--------Foo_tests.cpp(451B)