?? suite.h
字號:
//: TestSuite:Suite.h
// From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison.
// (c) 1995-2004 MindView, Inc. All Rights Reserved.
// See source code use permissions stated in the file 'License.txt',
// distributed with the code package available at www.MindView.net.
#ifndef SUITE_H
#define SUITE_H
#include <vector>
#include <stdexcept>
#include "../TestSuite/Test.h"
using std::vector;
using std::logic_error;
namespace TestSuite {
class TestSuiteError : public logic_error {
public:
TestSuiteError(const string& s = "")
: logic_error(s) {}
};
class Suite {
string name;
ostream* osptr;
vector<Test*> tests;
void reset();
// Disallowed ops:
Suite(const Suite&);
Suite& operator=(const Suite&);
public:
Suite(const string& name, ostream* osptr = &cout)
: name(name) { this->osptr = osptr; }
string getName() const { return name; }
long getNumPassed() const;
long getNumFailed() const;
const ostream* getStream() const { return osptr; }
void setStream(ostream* osptr) { this->osptr = osptr; }
void addTest(Test* t) throw(TestSuiteError);
void addSuite(const Suite&);
void run(); // Calls Test::run() repeatedly
long report() const;
void free(); // Deletes tests
};
} // namespace TestSuite
#endif // SUITE_H ///:~
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -