Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
d56773b4
Commit
d56773b4
authored
Dec 16, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turns on -Wshadow (by Preston Jackson).
parent
35087841
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
90 additions
and
85 deletions
+90
-85
gtest-test-part.h
include/gtest/gtest-test-part.h
+9
-9
gtest.h
include/gtest/gtest.h
+2
-2
gtest-death-test-internal.h
include/gtest/internal/gtest-death-test-internal.h
+6
-5
gtest-param-util.h
include/gtest/internal/gtest-param-util.h
+6
-6
gtest-string.h
include/gtest/internal/gtest-string.h
+15
-13
SConstruct.common
scons/SConstruct.common
+1
-0
gtest-death-test.cc
src/gtest-death-test.cc
+16
-16
gtest-internal-inl.h
src/gtest-internal-inl.h
+4
-4
gtest.cc
src/gtest.cc
+22
-21
gtest-param-test_test.cc
test/gtest-param-test_test.cc
+2
-2
gtest_unittest.cc
test/gtest_unittest.cc
+5
-5
production.h
test/production.h
+1
-1
General.xcconfig
xcode/Config/General.xcconfig
+1
-1
No files found.
include/gtest/gtest-test-part.h
View file @
d56773b4
...
@@ -56,15 +56,15 @@ class TestPartResult {
...
@@ -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.
...
...
include/gtest/gtest.h
View file @
d56773b4
...
@@ -457,8 +457,8 @@ class TestProperty {
...
@@ -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.
...
...
include/gtest/internal/gtest-death-test-internal.h
View file @
d56773b4
...
@@ -189,11 +189,12 @@ bool ExitedUnsuccessfully(int exit_status);
...
@@ -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
)
...
...
include/gtest/internal/gtest-param-util.h
View file @
d56773b4
...
@@ -544,12 +544,12 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
...
@@ -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
;
...
...
include/gtest/internal/gtest-string.h
View file @
d56773b4
...
@@ -190,12 +190,12 @@ class String {
...
@@ -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 {
...
@@ -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 {
...
@@ -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 {
...
@@ -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 {
...
@@ -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 {
...
@@ -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_
;
...
...
scons/SConstruct.common
View file @
d56773b4
...
@@ -193,6 +193,7 @@ class SConstructHelper:
...
@@ -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'])
...
...
src/gtest-death-test.cc
View file @
d56773b4
...
@@ -308,9 +308,9 @@ String DeathTest::last_death_test_message_;
...
@@ -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 {
...
@@ -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 {
...
@@ -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() {
...
@@ -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() {
...
@@ -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.
...
...
src/gtest-internal-inl.h
View file @
d56773b4
...
@@ -902,15 +902,15 @@ class UnitTestImpl {
...
@@ -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
...
...
src/gtest.cc
View file @
d56773b4
...
@@ -2123,14 +2123,14 @@ bool Test::HasNonfatalFailure() {
...
@@ -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 {
...
@@ -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() {
...
@@ -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() {
...
@@ -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
),
...
...
test/gtest-param-test_test.cc
View file @
d56773b4
...
@@ -205,7 +205,7 @@ TEST(RangeTest, IntRangeWithCustomStepOverUpperBound) {
...
@@ -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) {
...
@@ -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
)
{
...
...
test/gtest_unittest.cc
View file @
d56773b4
...
@@ -4009,7 +4009,7 @@ TEST(AssertionTest, NonFixtureSubroutine) {
...
@@ -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) {
...
@@ -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) {
...
@@ -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) {
...
@@ -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) {
...
@@ -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
,
...
...
test/production.h
View file @
d56773b4
...
@@ -48,7 +48,7 @@ class PrivateCode {
...
@@ -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_
;
};
};
...
...
xcode/Config/General.xcconfig
View file @
d56773b4
...
@@ -17,7 +17,7 @@ ZERO_LINK = NO
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment