📄 suite.h
字号:
// suite.h#ifndef SUITE_H#define SUITE_H#include "test.h" // includes <string>, <iosfwd>#include <vector>using std::string;using std::ostream;using std::vector;class TestSuiteError;class Suite{public: Suite(const string& name, ostream* osptr = 0); string getName() const; long getNumPassed() const; long getNumFailed() const; const ostream* getStream() const; void setStream(ostream* osptr); void addTest(Test* t) throw (TestSuiteError); void addSuite(const Suite&) throw(TestSuiteError); void run(); // Calls Test::run() repeatedly long report() const; void free(); // deletes testsprivate: string m_name; ostream* m_osptr; vector<Test*> m_tests; void reset(); // Disallowed ops: Suite(const Suite&); Suite& operator=(const Suite&);};inlineSuite::Suite(const string& name, ostream* osptr) : m_name(name){ m_osptr = osptr;}inlinestring Suite::getName() const{ return m_name;}inlineconst ostream* Suite::getStream() const{ return m_osptr;}inlinevoid Suite::setStream(ostream* osptr){ m_osptr = osptr;}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -