mirror of
https://github.com/google/googletest.git
synced 2025-03-17 17:03:47 +00:00
Turns on -Wshadow (by Preston Jackson).
This commit is contained in:
parent
3508784108
commit
d56773b492
@ -56,15 +56,15 @@ class TestPartResult {
|
|||||||
// C'tor. TestPartResult does NOT have a default constructor.
|
// C'tor. TestPartResult does NOT have a default constructor.
|
||||||
// Always use this constructor (with parameters) to create a
|
// Always use this constructor (with parameters) to create a
|
||||||
// TestPartResult object.
|
// TestPartResult object.
|
||||||
TestPartResult(Type type,
|
TestPartResult(Type a_type,
|
||||||
const char* file_name,
|
const char* a_file_name,
|
||||||
int line_number,
|
int a_line_number,
|
||||||
const char* message)
|
const char* a_message)
|
||||||
: type_(type),
|
: type_(a_type),
|
||||||
file_name_(file_name),
|
file_name_(a_file_name),
|
||||||
line_number_(line_number),
|
line_number_(a_line_number),
|
||||||
summary_(ExtractSummary(message)),
|
summary_(ExtractSummary(a_message)),
|
||||||
message_(message) {
|
message_(a_message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the outcome of the test part.
|
// Gets the outcome of the test part.
|
||||||
|
@ -457,8 +457,8 @@ class TestProperty {
|
|||||||
// C'tor. TestProperty does NOT have a default constructor.
|
// C'tor. TestProperty does NOT have a default constructor.
|
||||||
// Always use this constructor (with parameters) to create a
|
// Always use this constructor (with parameters) to create a
|
||||||
// TestProperty object.
|
// TestProperty object.
|
||||||
TestProperty(const char* key, const char* value) :
|
TestProperty(const char* a_key, const char* a_value) :
|
||||||
key_(key), value_(value) {
|
key_(a_key), value_(a_value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the user supplied key.
|
// Gets the user supplied key.
|
||||||
|
@ -189,11 +189,12 @@ bool ExitedUnsuccessfully(int exit_status);
|
|||||||
// RUN_ALL_TESTS was called.
|
// RUN_ALL_TESTS was called.
|
||||||
class InternalRunDeathTestFlag {
|
class InternalRunDeathTestFlag {
|
||||||
public:
|
public:
|
||||||
InternalRunDeathTestFlag(const String& file,
|
InternalRunDeathTestFlag(const String& a_file,
|
||||||
int line,
|
int a_line,
|
||||||
int index,
|
int an_index,
|
||||||
int write_fd)
|
int a_write_fd)
|
||||||
: file_(file), line_(line), index_(index), write_fd_(write_fd) {}
|
: file_(a_file), line_(a_line), index_(an_index),
|
||||||
|
write_fd_(a_write_fd) {}
|
||||||
|
|
||||||
~InternalRunDeathTestFlag() {
|
~InternalRunDeathTestFlag() {
|
||||||
if (write_fd_ >= 0)
|
if (write_fd_ >= 0)
|
||||||
|
@ -544,12 +544,12 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
|
|||||||
// LocalTestInfo structure keeps information about a single test registered
|
// LocalTestInfo structure keeps information about a single test registered
|
||||||
// with TEST_P macro.
|
// with TEST_P macro.
|
||||||
struct TestInfo {
|
struct TestInfo {
|
||||||
TestInfo(const char* test_case_base_name,
|
TestInfo(const char* a_test_case_base_name,
|
||||||
const char* test_base_name,
|
const char* a_test_base_name,
|
||||||
TestMetaFactoryBase<ParamType>* test_meta_factory) :
|
TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
|
||||||
test_case_base_name(test_case_base_name),
|
test_case_base_name(a_test_case_base_name),
|
||||||
test_base_name(test_base_name),
|
test_base_name(a_test_base_name),
|
||||||
test_meta_factory(test_meta_factory) {}
|
test_meta_factory(a_test_meta_factory) {}
|
||||||
|
|
||||||
const String test_case_base_name;
|
const String test_case_base_name;
|
||||||
const String test_base_name;
|
const String test_base_name;
|
||||||
|
@ -190,12 +190,12 @@ class String {
|
|||||||
String() : c_str_(NULL), length_(0) {}
|
String() : c_str_(NULL), length_(0) {}
|
||||||
|
|
||||||
// Constructs a String by cloning a 0-terminated C string.
|
// Constructs a String by cloning a 0-terminated C string.
|
||||||
String(const char* c_str) { // NOLINT
|
String(const char* a_c_str) { // NOLINT
|
||||||
if (c_str == NULL) {
|
if (a_c_str == NULL) {
|
||||||
c_str_ = NULL;
|
c_str_ = NULL;
|
||||||
length_ = 0;
|
length_ = 0;
|
||||||
} else {
|
} 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",
|
// buffer. E.g. String("hello", 3) creates the string "hel",
|
||||||
// String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
|
// String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
|
||||||
// and String(NULL, 1) results in access violation.
|
// and String(NULL, 1) results in access violation.
|
||||||
String(const char* buffer, size_t length) {
|
String(const char* buffer, size_t a_length) {
|
||||||
ConstructNonNull(buffer, length);
|
ConstructNonNull(buffer, a_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The copy c'tor creates a new copy of the string. The two
|
// 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
|
// Returns true iff this String equals the given C string. A NULL
|
||||||
// string and a non-NULL string are considered not equal.
|
// 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
|
// Returns true iff this String is less than the given String. A
|
||||||
// NULL string is considered less than "".
|
// 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
|
// Returns true iff this String doesn't equal the given C string. A NULL
|
||||||
// string and a non-NULL string are considered not equal.
|
// 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*
|
// Returns true iff this String ends with the given suffix. *Any*
|
||||||
// String is considered to end with a NULL or empty suffix.
|
// 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_; }
|
const char* c_str() const { return c_str_; }
|
||||||
|
|
||||||
// Assigns a C string to this object. Self-assignment works.
|
// 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.
|
// Assigns a String object to this object. Self-assignment works.
|
||||||
const String& operator=(const String& rhs) {
|
const String& operator=(const String& rhs) {
|
||||||
@ -297,12 +299,12 @@ class String {
|
|||||||
// function can only be called when data_ has not been allocated.
|
// function can only be called when data_ has not been allocated.
|
||||||
// ConstructNonNull(NULL, 0) results in an empty string ("").
|
// ConstructNonNull(NULL, 0) results in an empty string ("").
|
||||||
// ConstructNonNull(NULL, non_zero) is undefined behavior.
|
// ConstructNonNull(NULL, non_zero) is undefined behavior.
|
||||||
void ConstructNonNull(const char* buffer, size_t length) {
|
void ConstructNonNull(const char* buffer, size_t a_length) {
|
||||||
char* const str = new char[length + 1];
|
char* const str = new char[a_length + 1];
|
||||||
memcpy(str, buffer, length);
|
memcpy(str, buffer, a_length);
|
||||||
str[length] = '\0';
|
str[a_length] = '\0';
|
||||||
c_str_ = str;
|
c_str_ = str;
|
||||||
length_ = length;
|
length_ = a_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* c_str_;
|
const char* c_str_;
|
||||||
|
@ -193,6 +193,7 @@ class SConstructHelper:
|
|||||||
env.Append(CCFLAGS=['-fno-exceptions',
|
env.Append(CCFLAGS=['-fno-exceptions',
|
||||||
'-Wall',
|
'-Wall',
|
||||||
'-Werror',
|
'-Werror',
|
||||||
|
'-Wshadow',
|
||||||
])
|
])
|
||||||
if optimized:
|
if optimized:
|
||||||
env.Append(CCFLAGS=['-O2'], CPPDEFINES=['NDEBUG', '_NDEBUG'])
|
env.Append(CCFLAGS=['-O2'], CPPDEFINES=['NDEBUG', '_NDEBUG'])
|
||||||
|
@ -308,9 +308,9 @@ String DeathTest::last_death_test_message_;
|
|||||||
// Provides cross platform implementation for some death functionality.
|
// Provides cross platform implementation for some death functionality.
|
||||||
class DeathTestImpl : public DeathTest {
|
class DeathTestImpl : public DeathTest {
|
||||||
protected:
|
protected:
|
||||||
DeathTestImpl(const char* statement, const RE* regex)
|
DeathTestImpl(const char* a_statement, const RE* a_regex)
|
||||||
: statement_(statement),
|
: statement_(a_statement),
|
||||||
regex_(regex),
|
regex_(a_regex),
|
||||||
spawned_(false),
|
spawned_(false),
|
||||||
status_(-1),
|
status_(-1),
|
||||||
outcome_(IN_PROGRESS),
|
outcome_(IN_PROGRESS),
|
||||||
@ -326,11 +326,11 @@ class DeathTestImpl : public DeathTest {
|
|||||||
const char* statement() const { return statement_; }
|
const char* statement() const { return statement_; }
|
||||||
const RE* regex() const { return regex_; }
|
const RE* regex() const { return regex_; }
|
||||||
bool spawned() const { return spawned_; }
|
bool spawned() const { return spawned_; }
|
||||||
void set_spawned(bool spawned) { spawned_ = spawned; }
|
void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
|
||||||
int status() const { return status_; }
|
int status() const { return status_; }
|
||||||
void set_status(int status) { status_ = status; }
|
void set_status(int a_status) { status_ = a_status; }
|
||||||
DeathTestOutcome outcome() const { return outcome_; }
|
DeathTestOutcome outcome() const { return outcome_; }
|
||||||
void set_outcome(DeathTestOutcome outcome) { outcome_ = outcome; }
|
void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }
|
||||||
int read_fd() const { return read_fd_; }
|
int read_fd() const { return read_fd_; }
|
||||||
void set_read_fd(int fd) { read_fd_ = fd; }
|
void set_read_fd(int fd) { read_fd_ = fd; }
|
||||||
int write_fd() const { return write_fd_; }
|
int write_fd() const { return write_fd_; }
|
||||||
@ -705,8 +705,8 @@ class ForkingDeathTest : public DeathTestImpl {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Constructs a ForkingDeathTest.
|
// Constructs a ForkingDeathTest.
|
||||||
ForkingDeathTest::ForkingDeathTest(const char* statement, const RE* regex)
|
ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)
|
||||||
: DeathTestImpl(statement, regex),
|
: DeathTestImpl(a_statement, a_regex),
|
||||||
child_pid_(-1) {}
|
child_pid_(-1) {}
|
||||||
|
|
||||||
// Waits for the child in a death test to exit, returning its exit
|
// Waits for the child in a death test to exit, returning its exit
|
||||||
@ -718,18 +718,18 @@ int ForkingDeathTest::Wait() {
|
|||||||
|
|
||||||
ReadAndInterpretStatusByte();
|
ReadAndInterpretStatusByte();
|
||||||
|
|
||||||
int status;
|
int status_value;
|
||||||
GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status, 0));
|
GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));
|
||||||
set_status(status);
|
set_status(status_value);
|
||||||
return status;
|
return status_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A concrete death test class that forks, then immediately runs the test
|
// A concrete death test class that forks, then immediately runs the test
|
||||||
// in the child process.
|
// in the child process.
|
||||||
class NoExecDeathTest : public ForkingDeathTest {
|
class NoExecDeathTest : public ForkingDeathTest {
|
||||||
public:
|
public:
|
||||||
NoExecDeathTest(const char* statement, const RE* regex) :
|
NoExecDeathTest(const char* a_statement, const RE* a_regex) :
|
||||||
ForkingDeathTest(statement, regex) { }
|
ForkingDeathTest(a_statement, a_regex) { }
|
||||||
virtual TestRole AssumeRole();
|
virtual TestRole AssumeRole();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -782,9 +782,9 @@ DeathTest::TestRole NoExecDeathTest::AssumeRole() {
|
|||||||
// only this specific death test to be run.
|
// only this specific death test to be run.
|
||||||
class ExecDeathTest : public ForkingDeathTest {
|
class ExecDeathTest : public ForkingDeathTest {
|
||||||
public:
|
public:
|
||||||
ExecDeathTest(const char* statement, const RE* regex,
|
ExecDeathTest(const char* a_statement, const RE* a_regex,
|
||||||
const char* file, int line) :
|
const char* file, int line) :
|
||||||
ForkingDeathTest(statement, regex), file_(file), line_(line) { }
|
ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
|
||||||
virtual TestRole AssumeRole();
|
virtual TestRole AssumeRole();
|
||||||
private:
|
private:
|
||||||
// The name of the file in which the death test is located.
|
// The name of the file in which the death test is located.
|
||||||
|
@ -902,15 +902,15 @@ class UnitTestImpl {
|
|||||||
#endif // GTEST_HAS_PARAM_TEST
|
#endif // GTEST_HAS_PARAM_TEST
|
||||||
|
|
||||||
// Sets the TestCase object for the test that's currently running.
|
// Sets the TestCase object for the test that's currently running.
|
||||||
void set_current_test_case(TestCase* current_test_case) {
|
void set_current_test_case(TestCase* a_current_test_case) {
|
||||||
current_test_case_ = current_test_case;
|
current_test_case_ = a_current_test_case;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets the TestInfo object for the test that's currently running. If
|
// Sets the TestInfo object for the test that's currently running. If
|
||||||
// current_test_info is NULL, the assertion results will be stored in
|
// current_test_info is NULL, the assertion results will be stored in
|
||||||
// ad_hoc_test_result_.
|
// ad_hoc_test_result_.
|
||||||
void set_current_test_info(TestInfo* current_test_info) {
|
void set_current_test_info(TestInfo* a_current_test_info) {
|
||||||
current_test_info_ = current_test_info;
|
current_test_info_ = a_current_test_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Registers all parameterized tests defined using TEST_P and
|
// Registers all parameterized tests defined using TEST_P and
|
||||||
|
43
src/gtest.cc
43
src/gtest.cc
@ -2123,14 +2123,14 @@ bool Test::HasNonfatalFailure() {
|
|||||||
|
|
||||||
// Constructs a TestInfo object. It assumes ownership of the test factory
|
// Constructs a TestInfo object. It assumes ownership of the test factory
|
||||||
// object via impl_.
|
// object via impl_.
|
||||||
TestInfo::TestInfo(const char* test_case_name,
|
TestInfo::TestInfo(const char* a_test_case_name,
|
||||||
const char* name,
|
const char* a_name,
|
||||||
const char* test_case_comment,
|
const char* a_test_case_comment,
|
||||||
const char* comment,
|
const char* a_comment,
|
||||||
internal::TypeId fixture_class_id,
|
internal::TypeId fixture_class_id,
|
||||||
internal::TestFactoryBase* factory) {
|
internal::TestFactoryBase* factory) {
|
||||||
impl_ = new internal::TestInfoImpl(this, test_case_name, name,
|
impl_ = new internal::TestInfoImpl(this, a_test_case_name, a_name,
|
||||||
test_case_comment, comment,
|
a_test_case_comment, a_comment,
|
||||||
fixture_class_id, factory);
|
fixture_class_id, factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2368,11 +2368,11 @@ int TestCase::total_test_count() const {
|
|||||||
// name: name of the test case
|
// name: name of the test case
|
||||||
// set_up_tc: pointer to the function that sets up the test case
|
// set_up_tc: pointer to the function that sets up the test case
|
||||||
// tear_down_tc: pointer to the function that tears down the test case
|
// tear_down_tc: pointer to the function that tears down the test case
|
||||||
TestCase::TestCase(const char* name, const char* comment,
|
TestCase::TestCase(const char* a_name, const char* a_comment,
|
||||||
Test::SetUpTestCaseFunc set_up_tc,
|
Test::SetUpTestCaseFunc set_up_tc,
|
||||||
Test::TearDownTestCaseFunc tear_down_tc)
|
Test::TearDownTestCaseFunc tear_down_tc)
|
||||||
: name_(name),
|
: name_(a_name),
|
||||||
comment_(comment),
|
comment_(a_comment),
|
||||||
test_info_list_(new internal::Vector<TestInfo*>),
|
test_info_list_(new internal::Vector<TestInfo*>),
|
||||||
test_indices_(new internal::Vector<int>),
|
test_indices_(new internal::Vector<int>),
|
||||||
set_up_tc_(set_up_tc),
|
set_up_tc_(set_up_tc),
|
||||||
@ -4022,8 +4022,9 @@ int UnitTestImpl::RunAllTests() {
|
|||||||
// Runs the tests only if there was no fatal failure during global
|
// Runs the tests only if there was no fatal failure during global
|
||||||
// set-up.
|
// set-up.
|
||||||
if (!Test::HasFatalFailure()) {
|
if (!Test::HasFatalFailure()) {
|
||||||
for (int i = 0; i < total_test_case_count(); i++) {
|
for (int test_index = 0; test_index < total_test_case_count();
|
||||||
GetMutableTestCase(i)->Run();
|
test_index++) {
|
||||||
|
GetMutableTestCase(test_index)->Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4297,18 +4298,18 @@ void UnitTestImpl::UnshuffleTests() {
|
|||||||
// TestInfoImpl constructor. The new instance assumes ownership of the test
|
// TestInfoImpl constructor. The new instance assumes ownership of the test
|
||||||
// factory object.
|
// factory object.
|
||||||
TestInfoImpl::TestInfoImpl(TestInfo* parent,
|
TestInfoImpl::TestInfoImpl(TestInfo* parent,
|
||||||
const char* test_case_name,
|
const char* a_test_case_name,
|
||||||
const char* name,
|
const char* a_name,
|
||||||
const char* test_case_comment,
|
const char* a_test_case_comment,
|
||||||
const char* comment,
|
const char* a_comment,
|
||||||
TypeId fixture_class_id,
|
TypeId a_fixture_class_id,
|
||||||
internal::TestFactoryBase* factory) :
|
internal::TestFactoryBase* factory) :
|
||||||
parent_(parent),
|
parent_(parent),
|
||||||
test_case_name_(String(test_case_name)),
|
test_case_name_(String(a_test_case_name)),
|
||||||
name_(String(name)),
|
name_(String(a_name)),
|
||||||
test_case_comment_(String(test_case_comment)),
|
test_case_comment_(String(a_test_case_comment)),
|
||||||
comment_(String(comment)),
|
comment_(String(a_comment)),
|
||||||
fixture_class_id_(fixture_class_id),
|
fixture_class_id_(a_fixture_class_id),
|
||||||
should_run_(false),
|
should_run_(false),
|
||||||
is_disabled_(false),
|
is_disabled_(false),
|
||||||
matches_filter_(false),
|
matches_filter_(false),
|
||||||
|
@ -205,7 +205,7 @@ TEST(RangeTest, IntRangeWithCustomStepOverUpperBound) {
|
|||||||
// copy constructor, operator=(), operator+(), and operator<().
|
// copy constructor, operator=(), operator+(), and operator<().
|
||||||
class DogAdder {
|
class DogAdder {
|
||||||
public:
|
public:
|
||||||
explicit DogAdder(const char* value) : value_(value) {}
|
explicit DogAdder(const char* a_value) : value_(a_value) {}
|
||||||
DogAdder(const DogAdder& other) : value_(other.value_.c_str()) {}
|
DogAdder(const DogAdder& other) : value_(other.value_.c_str()) {}
|
||||||
|
|
||||||
DogAdder operator=(const DogAdder& other) {
|
DogAdder operator=(const DogAdder& other) {
|
||||||
@ -243,7 +243,7 @@ TEST(RangeTest, WorksWithACustomType) {
|
|||||||
|
|
||||||
class IntWrapper {
|
class IntWrapper {
|
||||||
public:
|
public:
|
||||||
explicit IntWrapper(int value) : value_(value) {}
|
explicit IntWrapper(int a_value) : value_(a_value) {}
|
||||||
IntWrapper(const IntWrapper& other) : value_(other.value_) {}
|
IntWrapper(const IntWrapper& other) : value_(other.value_) {}
|
||||||
|
|
||||||
IntWrapper operator=(const IntWrapper& other) {
|
IntWrapper operator=(const IntWrapper& other) {
|
||||||
|
@ -4009,7 +4009,7 @@ TEST(AssertionTest, NonFixtureSubroutine) {
|
|||||||
// An uncopyable class.
|
// An uncopyable class.
|
||||||
class Uncopyable {
|
class Uncopyable {
|
||||||
public:
|
public:
|
||||||
explicit Uncopyable(int value) : value_(value) {}
|
explicit Uncopyable(int a_value) : value_(a_value) {}
|
||||||
|
|
||||||
int value() const { return value_; }
|
int value() const { return value_; }
|
||||||
bool operator==(const Uncopyable& rhs) const {
|
bool operator==(const Uncopyable& rhs) const {
|
||||||
@ -5095,7 +5095,7 @@ TEST(AssertionResultTest, StreamingWorks) {
|
|||||||
// both in the global namespace.
|
// both in the global namespace.
|
||||||
class Base {
|
class Base {
|
||||||
public:
|
public:
|
||||||
explicit Base(int x) : x_(x) {}
|
explicit Base(int an_x) : x_(an_x) {}
|
||||||
int x() const { return x_; }
|
int x() const { return x_; }
|
||||||
private:
|
private:
|
||||||
int x_;
|
int x_;
|
||||||
@ -5122,7 +5122,7 @@ TEST(MessageTest, CanStreamUserTypeInGlobalNameSpace) {
|
|||||||
namespace {
|
namespace {
|
||||||
class MyTypeInUnnamedNameSpace : public Base {
|
class MyTypeInUnnamedNameSpace : public Base {
|
||||||
public:
|
public:
|
||||||
explicit MyTypeInUnnamedNameSpace(int x): Base(x) {}
|
explicit MyTypeInUnnamedNameSpace(int an_x): Base(an_x) {}
|
||||||
};
|
};
|
||||||
std::ostream& operator<<(std::ostream& os,
|
std::ostream& operator<<(std::ostream& os,
|
||||||
const MyTypeInUnnamedNameSpace& val) {
|
const MyTypeInUnnamedNameSpace& val) {
|
||||||
@ -5147,7 +5147,7 @@ TEST(MessageTest, CanStreamUserTypeInUnnamedNameSpace) {
|
|||||||
namespace namespace1 {
|
namespace namespace1 {
|
||||||
class MyTypeInNameSpace1 : public Base {
|
class MyTypeInNameSpace1 : public Base {
|
||||||
public:
|
public:
|
||||||
explicit MyTypeInNameSpace1(int x): Base(x) {}
|
explicit MyTypeInNameSpace1(int an_x): Base(an_x) {}
|
||||||
};
|
};
|
||||||
std::ostream& operator<<(std::ostream& os,
|
std::ostream& operator<<(std::ostream& os,
|
||||||
const MyTypeInNameSpace1& val) {
|
const MyTypeInNameSpace1& val) {
|
||||||
@ -5172,7 +5172,7 @@ TEST(MessageTest, CanStreamUserTypeInUserNameSpace) {
|
|||||||
namespace namespace2 {
|
namespace namespace2 {
|
||||||
class MyTypeInNameSpace2 : public ::Base {
|
class MyTypeInNameSpace2 : public ::Base {
|
||||||
public:
|
public:
|
||||||
explicit MyTypeInNameSpace2(int x): Base(x) {}
|
explicit MyTypeInNameSpace2(int an_x): Base(an_x) {}
|
||||||
};
|
};
|
||||||
} // namespace namespace2
|
} // namespace namespace2
|
||||||
std::ostream& operator<<(std::ostream& os,
|
std::ostream& operator<<(std::ostream& os,
|
||||||
|
@ -48,7 +48,7 @@ class PrivateCode {
|
|||||||
|
|
||||||
int x() const { return x_; }
|
int x() const { return x_; }
|
||||||
private:
|
private:
|
||||||
void set_x(int x) { x_ = x; }
|
void set_x(int an_x) { x_ = an_x; }
|
||||||
int x_;
|
int x_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ ZERO_LINK = NO
|
|||||||
PREBINDING = NO
|
PREBINDING = NO
|
||||||
|
|
||||||
// Strictest warning policy
|
// Strictest warning policy
|
||||||
WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare
|
WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow
|
||||||
|
|
||||||
// Work around Xcode bugs by using external strip. See:
|
// Work around Xcode bugs by using external strip. See:
|
||||||
// http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html
|
// http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user