aboutsummaryrefslogtreecommitdiffstats
path: root/gtest/include/gtest/gtest-test-part.h
diff options
context:
space:
mode:
Diffstat (limited to 'gtest/include/gtest/gtest-test-part.h')
-rw-r--r--gtest/include/gtest/gtest-test-part.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/gtest/include/gtest/gtest-test-part.h b/gtest/include/gtest/gtest-test-part.h
index f714759..58e7df9 100644
--- a/gtest/include/gtest/gtest-test-part.h
+++ b/gtest/include/gtest/gtest-test-part.h
@@ -34,7 +34,6 @@
#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
#include <iosfwd>
-#include <vector>
#include <gtest/internal/gtest-internal.h>
#include <gtest/internal/gtest-string.h>
@@ -44,7 +43,7 @@ namespace testing {
// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
//
// Don't inherit from TestPartResult as its destructor is not virtual.
-class GTEST_API_ TestPartResult {
+class TestPartResult {
public:
// The possible outcomes of a test part (i.e. an assertion or an
// explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
@@ -57,15 +56,15 @@ class GTEST_API_ TestPartResult {
// C'tor. TestPartResult does NOT have a default constructor.
// Always use this constructor (with parameters) to create a
// TestPartResult object.
- 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) {
+ 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) {
}
// Gets the outcome of the test part.
@@ -118,11 +117,15 @@ 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 GTEST_API_ TestPartResultArray {
+class TestPartResultArray {
public:
- TestPartResultArray() {}
+ TestPartResultArray();
+ ~TestPartResultArray();
// Appends the given TestPartResult to the array.
void Append(const TestPartResult& result);
@@ -132,9 +135,9 @@ class GTEST_API_ TestPartResultArray {
// Returns the number of TestPartResult objects in the array.
int size() const;
-
private:
- std::vector<TestPartResult> array_;
+ // Internally we use a Vector to implement the array.
+ internal::Vector<TestPartResult>* const array_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
};
@@ -155,8 +158,7 @@ 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 GTEST_API_ HasNewFatalFailureHelper
- : public TestPartResultReporterInterface {
+class HasNewFatalFailureHelper : public TestPartResultReporterInterface {
public:
HasNewFatalFailureHelper();
virtual ~HasNewFatalFailureHelper();