From 89080477aee9bd91536c9fb47bc31c62ea7d75bb Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Mon, 13 Jul 2009 19:25:02 +0000 Subject: Adds color support for TERM=linux (by Alexander Demin); renames List to Vector (by Zhanyong Wan); implements Vector::Erase (by Vlad Losev). --- include/gtest/gtest-message.h | 4 ++-- include/gtest/gtest-test-part.h | 5 ++--- include/gtest/gtest.h | 37 +++++++++++++++++---------------- include/gtest/internal/gtest-internal.h | 6 +++--- 4 files changed, 26 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/gtest/gtest-message.h b/include/gtest/gtest-message.h index 99ae4546..6398712e 100644 --- a/include/gtest/gtest-message.h +++ b/include/gtest/gtest-message.h @@ -193,7 +193,7 @@ class Message { // decide between class template specializations for T and T*, so a // tr1::type_traits-like is_pointer works, and we can overload on that. template - inline void StreamHelper(internal::true_type dummy, T* pointer) { + inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) { if (pointer == NULL) { *ss_ << "(null)"; } else { @@ -201,7 +201,7 @@ class Message { } } template - inline void StreamHelper(internal::false_type dummy, const T& value) { + inline void StreamHelper(internal::false_type /*dummy*/, const T& value) { ::GTestStreamToHelper(ss_, value); } #endif // GTEST_OS_SYMBIAN diff --git a/include/gtest/gtest-test-part.h b/include/gtest/gtest-test-part.h index 1a281afb..d5b27130 100644 --- a/include/gtest/gtest-test-part.h +++ b/include/gtest/gtest-test-part.h @@ -136,9 +136,8 @@ class TestPartResultArray { // Returns the number of TestPartResult objects in the array. int size() const; private: - // Internally we use a list to simulate the array. Yes, this means - // that random access is O(N) in time, but it's OK for its purpose. - internal::List* const list_; + // Internally we use a Vector to implement the array. + internal::Vector* const array_; GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); }; diff --git a/include/gtest/gtest.h b/include/gtest/gtest.h index f8aa91e8..5db7c18b 100644 --- a/include/gtest/gtest.h +++ b/include/gtest/gtest.h @@ -453,13 +453,13 @@ class TestResult { friend class testing::TestInfo; friend class testing::UnitTest; - // Gets the list of TestPartResults. - const internal::List& test_part_results() const { + // Gets the vector of TestPartResults. + const internal::Vector& test_part_results() const { return *test_part_results_; } - // Gets the list of TestProperties. - const internal::List& test_properties() const { + // Gets the vector of TestProperties. + const internal::Vector& test_properties() const { return *test_properties_; } @@ -493,14 +493,15 @@ class TestResult { // Clears the object. void Clear(); - // Protects mutable state of the property list and of owned properties, whose - // values may be updated. + // Protects mutable state of the property vector and of owned + // properties, whose values may be updated. internal::Mutex test_properites_mutex_; - // The list of TestPartResults - scoped_ptr > test_part_results_; - // The list of TestProperties - scoped_ptr > test_properties_; + // The vector of TestPartResults + internal::scoped_ptr > test_part_results_; + // The vector of TestProperties + internal::scoped_ptr > + test_properties_; // Running count of death tests. int death_test_count_; // The elapsed time, in milliseconds. @@ -604,7 +605,7 @@ class TestInfo { namespace internal { -// A test case, which consists of a list of TestInfos. +// A test case, which consists of a vector of TestInfos. // // TestCase is not copyable. class TestCase { @@ -667,11 +668,11 @@ class TestCase { friend class testing::Test; friend class UnitTestImpl; - // Gets the (mutable) list of TestInfos in this TestCase. - internal::List& test_info_list() { return *test_info_list_; } + // Gets the (mutable) vector of TestInfos in this TestCase. + internal::Vector& test_info_list() { return *test_info_list_; } - // Gets the (immutable) list of TestInfos in this TestCase. - const internal::List & test_info_list() const { + // Gets the (immutable) vector of TestInfos in this TestCase. + const internal::Vector & test_info_list() const { return *test_info_list_; } @@ -712,8 +713,8 @@ class TestCase { internal::String name_; // Comment on the test case. internal::String comment_; - // List of TestInfos. - internal::List* test_info_list_; + // Vector of TestInfos. + internal::Vector* test_info_list_; // Pointer to the function that sets up the test case. Test::SetUpTestCaseFunc set_up_tc_; // Pointer to the function that tears down the test case. @@ -760,7 +761,7 @@ class Environment { virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } }; -// A UnitTest consists of a list of TestCases. +// A UnitTest consists of a vector of TestCases. // // This is a singleton class. The only instance of UnitTest is // created when UnitTest::GetInstance() is first called. This diff --git a/include/gtest/internal/gtest-internal.h b/include/gtest/internal/gtest-internal.h index 91b386f0..76945551 100644 --- a/include/gtest/internal/gtest-internal.h +++ b/include/gtest/internal/gtest-internal.h @@ -116,7 +116,7 @@ class ScopedTrace; // Implements scoped trace. class TestInfoImpl; // Opaque implementation of TestInfo class TestResult; // Result of a single Test. class UnitTestImpl; // Opaque implementation of UnitTest -template class List; // A generic list. +template class Vector; // A generic vector. // How many times InitGoogleTest() has been called. extern int g_init_gtest_count; @@ -208,13 +208,13 @@ String StreamableToString(const T& streamable); // This overload makes sure that all pointers (including // those to char or wchar_t) are printed as raw pointers. template -inline String FormatValueForFailureMessage(internal::true_type dummy, +inline String FormatValueForFailureMessage(internal::true_type /*dummy*/, T* pointer) { return StreamableToString(static_cast(pointer)); } template -inline String FormatValueForFailureMessage(internal::false_type dummy, +inline String FormatValueForFailureMessage(internal::false_type /*dummy*/, const T& value) { return StreamableToString(value); } -- cgit v1.2.3