aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-07-13 19:25:02 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-07-13 19:25:02 +0000
commit89080477aee9bd91536c9fb47bc31c62ea7d75bb (patch)
tree982a302a1017c97c3cf11da4341492509a08dc2f /include
parent600105ee3ac48a01143486e5536a5b8fff5b5b25 (diff)
downloadgoogletest-89080477aee9bd91536c9fb47bc31c62ea7d75bb.tar.gz
googletest-89080477aee9bd91536c9fb47bc31c62ea7d75bb.tar.bz2
googletest-89080477aee9bd91536c9fb47bc31c62ea7d75bb.zip
Adds color support for TERM=linux (by Alexander Demin); renames List to Vector (by Zhanyong Wan); implements Vector::Erase (by Vlad Losev).
Diffstat (limited to 'include')
-rw-r--r--include/gtest/gtest-message.h4
-rw-r--r--include/gtest/gtest-test-part.h5
-rw-r--r--include/gtest/gtest.h37
-rw-r--r--include/gtest/internal/gtest-internal.h6
4 files changed, 26 insertions, 26 deletions
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 <typename T>
- 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 <typename T>
- 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<TestPartResult>* const list_;
+ // Internally we use a Vector to implement the array.
+ internal::Vector<TestPartResult>* 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<TestPartResult>& test_part_results() const {
+ // Gets the vector of TestPartResults.
+ const internal::Vector<TestPartResult>& test_part_results() const {
return *test_part_results_;
}
- // Gets the list of TestProperties.
- const internal::List<internal::TestProperty>& test_properties() const {
+ // Gets the vector of TestProperties.
+ const internal::Vector<internal::TestProperty>& 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<internal::List<TestPartResult> > test_part_results_;
- // The list of TestProperties
- scoped_ptr<internal::List<internal::TestProperty> > test_properties_;
+ // The vector of TestPartResults
+ internal::scoped_ptr<internal::Vector<TestPartResult> > test_part_results_;
+ // The vector of TestProperties
+ internal::scoped_ptr<internal::Vector<internal::TestProperty> >
+ 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<TestInfo*>& test_info_list() { return *test_info_list_; }
+ // Gets the (mutable) vector of TestInfos in this TestCase.
+ internal::Vector<TestInfo*>& test_info_list() { return *test_info_list_; }
- // Gets the (immutable) list of TestInfos in this TestCase.
- const internal::List<TestInfo *> & test_info_list() const {
+ // Gets the (immutable) vector of TestInfos in this TestCase.
+ const internal::Vector<TestInfo *> & 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<TestInfo*>* test_info_list_;
+ // Vector of TestInfos.
+ internal::Vector<TestInfo*>* 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 <typename E> class List; // A generic list.
+template <typename E> 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 <typename T>
-inline String FormatValueForFailureMessage(internal::true_type dummy,
+inline String FormatValueForFailureMessage(internal::true_type /*dummy*/,
T* pointer) {
return StreamableToString(static_cast<const void*>(pointer));
}
template <typename T>
-inline String FormatValueForFailureMessage(internal::false_type dummy,
+inline String FormatValueForFailureMessage(internal::false_type /*dummy*/,
const T& value) {
return StreamableToString(value);
}