diff options
Diffstat (limited to 'gtest/include/gtest/gtest-test-part.h')
-rw-r--r-- | gtest/include/gtest/gtest-test-part.h | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/gtest/include/gtest/gtest-test-part.h b/gtest/include/gtest/gtest-test-part.h index 58e7df9..f714759 100644 --- a/gtest/include/gtest/gtest-test-part.h +++ b/gtest/include/gtest/gtest-test-part.h @@ -34,6 +34,7 @@ #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ #include <iosfwd> +#include <vector> #include <gtest/internal/gtest-internal.h> #include <gtest/internal/gtest-string.h> @@ -43,7 +44,7 @@ namespace testing { // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()). // // Don't inherit from TestPartResult as its destructor is not virtual. -class TestPartResult { +class GTEST_API_ TestPartResult { public: // The possible outcomes of a test part (i.e. an assertion or an // explicit SUCCEED(), FAIL(), or ADD_FAILURE()). @@ -56,15 +57,15 @@ class TestPartResult { // C'tor. TestPartResult does NOT have a default constructor. // Always use this constructor (with parameters) to create a // TestPartResult object. - TestPartResult(Type type, - const char* file_name, - int line_number, - const char* message) - : type_(type), - file_name_(file_name), - line_number_(line_number), - summary_(ExtractSummary(message)), - message_(message) { + TestPartResult(Type a_type, + const char* a_file_name, + int a_line_number, + const char* a_message) + : type_(a_type), + file_name_(a_file_name), + line_number_(a_line_number), + summary_(ExtractSummary(a_message)), + message_(a_message) { } // Gets the outcome of the test part. @@ -117,15 +118,11 @@ std::ostream& operator<<(std::ostream& os, const TestPartResult& result); // An array of TestPartResult objects. // -// We define this class as we cannot use STL containers when compiling -// Google Test with MSVC 7.1 and exceptions disabled. -// // Don't inherit from TestPartResultArray as its destructor is not // virtual. -class TestPartResultArray { +class GTEST_API_ TestPartResultArray { public: - TestPartResultArray(); - ~TestPartResultArray(); + TestPartResultArray() {} // Appends the given TestPartResult to the array. void Append(const TestPartResult& result); @@ -135,9 +132,9 @@ class TestPartResultArray { // Returns the number of TestPartResult objects in the array. int size() const; + private: - // Internally we use a Vector to implement the array. - internal::Vector<TestPartResult>* const array_; + std::vector<TestPartResult> array_; GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); }; @@ -158,7 +155,8 @@ namespace internal { // reported, it only delegates the reporting to the former result reporter. // The original result reporter is restored in the destructor. // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -class HasNewFatalFailureHelper : public TestPartResultReporterInterface { +class GTEST_API_ HasNewFatalFailureHelper + : public TestPartResultReporterInterface { public: HasNewFatalFailureHelper(); virtual ~HasNewFatalFailureHelper(); |