summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-12-16 19:54:05 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-12-16 19:54:05 (GMT)
commitd56773b492b7b675d5c547baab815289a7815bdd (patch)
tree59322de2099c9879b4a10a298ecf6e6b03a63ace /include
parent3508784108a38d673a0c7d14c897e7a51b2a7e36 (diff)
downloadgoogletest-d56773b492b7b675d5c547baab815289a7815bdd.zip
googletest-d56773b492b7b675d5c547baab815289a7815bdd.tar.gz
googletest-d56773b492b7b675d5c547baab815289a7815bdd.tar.bz2
Turns on -Wshadow (by Preston Jackson).
Diffstat (limited to 'include')
-rw-r--r--include/gtest/gtest-test-part.h18
-rw-r--r--include/gtest/gtest.h4
-rw-r--r--include/gtest/internal/gtest-death-test-internal.h11
-rw-r--r--include/gtest/internal/gtest-param-util.h12
-rw-r--r--include/gtest/internal/gtest-string.h28
5 files changed, 38 insertions, 35 deletions
diff --git a/include/gtest/gtest-test-part.h b/include/gtest/gtest-test-part.h
index 58e7df9..348e4ec 100644
--- a/include/gtest/gtest-test-part.h
+++ b/include/gtest/gtest-test-part.h
@@ -56,15 +56,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.
diff --git a/include/gtest/gtest.h b/include/gtest/gtest.h
index 33e2f7f..c7df7f0 100644
--- a/include/gtest/gtest.h
+++ b/include/gtest/gtest.h
@@ -457,8 +457,8 @@ class TestProperty {
// C'tor. TestProperty does NOT have a default constructor.
// Always use this constructor (with parameters) to create a
// TestProperty object.
- TestProperty(const char* key, const char* value) :
- key_(key), value_(value) {
+ TestProperty(const char* a_key, const char* a_value) :
+ key_(a_key), value_(a_value) {
}
// Gets the user supplied key.
diff --git a/include/gtest/internal/gtest-death-test-internal.h b/include/gtest/internal/gtest-death-test-internal.h
index 5aba1a0..e98650e 100644
--- a/include/gtest/internal/gtest-death-test-internal.h
+++ b/include/gtest/internal/gtest-death-test-internal.h
@@ -189,11 +189,12 @@ bool ExitedUnsuccessfully(int exit_status);
// RUN_ALL_TESTS was called.
class InternalRunDeathTestFlag {
public:
- InternalRunDeathTestFlag(const String& file,
- int line,
- int index,
- int write_fd)
- : file_(file), line_(line), index_(index), write_fd_(write_fd) {}
+ InternalRunDeathTestFlag(const String& a_file,
+ int a_line,
+ int an_index,
+ int a_write_fd)
+ : file_(a_file), line_(a_line), index_(an_index),
+ write_fd_(a_write_fd) {}
~InternalRunDeathTestFlag() {
if (write_fd_ >= 0)
diff --git a/include/gtest/internal/gtest-param-util.h b/include/gtest/internal/gtest-param-util.h
index 19295d7..8dec853 100644
--- a/include/gtest/internal/gtest-param-util.h
+++ b/include/gtest/internal/gtest-param-util.h
@@ -544,12 +544,12 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
// LocalTestInfo structure keeps information about a single test registered
// with TEST_P macro.
struct TestInfo {
- TestInfo(const char* test_case_base_name,
- const char* test_base_name,
- TestMetaFactoryBase<ParamType>* test_meta_factory) :
- test_case_base_name(test_case_base_name),
- test_base_name(test_base_name),
- test_meta_factory(test_meta_factory) {}
+ TestInfo(const char* a_test_case_base_name,
+ const char* a_test_base_name,
+ TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
+ test_case_base_name(a_test_case_base_name),
+ test_base_name(a_test_base_name),
+ test_meta_factory(a_test_meta_factory) {}
const String test_case_base_name;
const String test_base_name;
diff --git a/include/gtest/internal/gtest-string.h b/include/gtest/internal/gtest-string.h
index 4bc8241..076119a 100644
--- a/include/gtest/internal/gtest-string.h
+++ b/include/gtest/internal/gtest-string.h
@@ -190,12 +190,12 @@ class String {
String() : c_str_(NULL), length_(0) {}
// Constructs a String by cloning a 0-terminated C string.
- String(const char* c_str) { // NOLINT
- if (c_str == NULL) {
+ String(const char* a_c_str) { // NOLINT
+ if (a_c_str == NULL) {
c_str_ = NULL;
length_ = 0;
} else {
- ConstructNonNull(c_str, strlen(c_str));
+ ConstructNonNull(a_c_str, strlen(a_c_str));
}
}
@@ -203,8 +203,8 @@ class String {
// buffer. E.g. String("hello", 3) creates the string "hel",
// String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
// and String(NULL, 1) results in access violation.
- String(const char* buffer, size_t length) {
- ConstructNonNull(buffer, length);
+ String(const char* buffer, size_t a_length) {
+ ConstructNonNull(buffer, a_length);
}
// The copy c'tor creates a new copy of the string. The two
@@ -247,7 +247,7 @@ class String {
// Returns true iff this String equals the given C string. A NULL
// string and a non-NULL string are considered not equal.
- bool operator==(const char* c_str) const { return Compare(c_str) == 0; }
+ bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
// Returns true iff this String is less than the given String. A
// NULL string is considered less than "".
@@ -255,7 +255,7 @@ class String {
// Returns true iff this String doesn't equal the given C string. A NULL
// string and a non-NULL string are considered not equal.
- bool operator!=(const char* c_str) const { return !(*this == c_str); }
+ bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
// Returns true iff this String ends with the given suffix. *Any*
// String is considered to end with a NULL or empty suffix.
@@ -275,7 +275,9 @@ class String {
const char* c_str() const { return c_str_; }
// Assigns a C string to this object. Self-assignment works.
- const String& operator=(const char* c_str) { return *this = String(c_str); }
+ const String& operator=(const char* a_c_str) {
+ return *this = String(a_c_str);
+ }
// Assigns a String object to this object. Self-assignment works.
const String& operator=(const String& rhs) {
@@ -297,12 +299,12 @@ class String {
// function can only be called when data_ has not been allocated.
// ConstructNonNull(NULL, 0) results in an empty string ("").
// ConstructNonNull(NULL, non_zero) is undefined behavior.
- void ConstructNonNull(const char* buffer, size_t length) {
- char* const str = new char[length + 1];
- memcpy(str, buffer, length);
- str[length] = '\0';
+ void ConstructNonNull(const char* buffer, size_t a_length) {
+ char* const str = new char[a_length + 1];
+ memcpy(str, buffer, a_length);
+ str[a_length] = '\0';
c_str_ = str;
- length_ = length;
+ length_ = a_length;
}
const char* c_str_;