- TestGroups all_tests; /// holds all test results
- std::string filename; /// filename base
-
- /**
- * \brief Initializes object
- * Resets counters and clears all stored test results.
- */
- virtual void init()
- {
- ok_count = 0;
- exceptions_count = 0;
- failures_count = 0;
- terminations_count = 0;
- warnings_count = 0;
- all_tests.clear();
- }
-
- /**
- * \brief Encodes text to XML
- * XML-reserved characters (e.g. "<") are encoded according to specification
- * @param text text to be encoded
- * @return encoded string
- */
- virtual std::string encode(const std::string & text)
- {
- std::string out;
-
- for (unsigned int i=0; i<text.length(); ++i) {
- char c = text[i];
- switch (c) {
- case '<':
- out += "<";
- break;
- case '>':
- out += ">";
- break;
- case '&':
- out += "&";
- break;
- case '\'':
- out += "'";
- break;
- case '"':
- out += """;
- break;
- default:
- out += c;
- }
- }
-
- return out;
- }
+ TestGroups all_tests_; /// holds all test results
+ const std::string filename_; /// filename base
+ std::auto_ptr<std::ostream> stream_;