diff options
Diffstat (limited to 'gtest/src/gtest-test-part.cc')
-rw-r--r-- | gtest/src/gtest-test-part.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gtest/src/gtest-test-part.cc b/gtest/src/gtest-test-part.cc index 5d183a4..4f36df6 100644 --- a/gtest/src/gtest-test-part.cc +++ b/gtest/src/gtest-test-part.cc @@ -64,9 +64,19 @@ std::ostream& operator<<(std::ostream& os, const TestPartResult& result) { << result.message() << std::endl; } +// Constructs an empty TestPartResultArray. +TestPartResultArray::TestPartResultArray() + : array_(new internal::Vector<TestPartResult>) { +} + +// Destructs a TestPartResultArray. +TestPartResultArray::~TestPartResultArray() { + delete array_; +} + // Appends a TestPartResult to the array. void TestPartResultArray::Append(const TestPartResult& result) { - array_.push_back(result); + array_->PushBack(result); } // Returns the TestPartResult at the given index (0-based). @@ -76,12 +86,12 @@ const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const { internal::posix::Abort(); } - return array_[index]; + return array_->GetElement(index); } // Returns the number of TestPartResult objects in the array. int TestPartResultArray::size() const { - return static_cast<int>(array_.size()); + return array_->size(); } namespace internal { |