Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
7107c441
Commit
7107c441
authored
Jul 01, 2022
by
Alexander Nikforov
Browse files
cleanup from unique_ptr branch
parent
4219e725
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
10 deletions
+8
-10
googlemock/src/gmock-internal-utils.cc
googlemock/src/gmock-internal-utils.cc
+1
-2
googletest/include/gtest/internal/gtest-internal.h
googletest/include/gtest/internal/gtest-internal.h
+1
-2
googletest/src/gtest.cc
googletest/src/gtest.cc
+1
-1
googletest/test/googletest-param-test-test.cc
googletest/test/googletest-param-test-test.cc
+2
-2
googletest/test/gtest-unittest-api_test.cc
googletest/test/gtest-unittest-api_test.cc
+2
-2
googletest/test/gtest_unittest.cc
googletest/test/gtest_unittest.cc
+1
-1
No files found.
googlemock/src/gmock-internal-utils.cc
View file @
7107c441
...
@@ -180,8 +180,7 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
...
@@ -180,8 +180,7 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
std
::
cout
<<
"
\n
"
;
std
::
cout
<<
"
\n
"
;
}
}
std
::
cout
<<
"Stack trace:
\n
"
std
::
cout
<<
"Stack trace:
\n
"
<<
::
testing
::
internal
::
GetCurrentOsStackTraceExceptTop
(
<<
::
testing
::
internal
::
GetCurrentOsStackTraceExceptTop
(
actual_to_skip
);
::
testing
::
UnitTest
::
GetInstance
(),
actual_to_skip
);
}
}
std
::
cout
<<
::
std
::
flush
;
std
::
cout
<<
::
std
::
flush
;
}
}
...
...
googletest/include/gtest/internal/gtest-internal.h
View file @
7107c441
...
@@ -829,8 +829,7 @@ class TypeParameterizedTestSuite<Fixture, internal::None, Types> {
...
@@ -829,8 +829,7 @@ class TypeParameterizedTestSuite<Fixture, internal::None, Types> {
// For example, if Foo() calls Bar(), which in turn calls
// For example, if Foo() calls Bar(), which in turn calls
// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
GTEST_API_
std
::
string
GetCurrentOsStackTraceExceptTop
(
UnitTest
*
unit_test
,
GTEST_API_
std
::
string
GetCurrentOsStackTraceExceptTop
(
int
skip_count
);
int
skip_count
);
// Helpers for suppressing warnings on unreachable code or constant
// Helpers for suppressing warnings on unreachable code or constant
// condition.
// condition.
...
...
googletest/src/gtest.cc
View file @
7107c441
...
@@ -6245,7 +6245,7 @@ void UnitTestImpl::UnshuffleTests() {
...
@@ -6245,7 +6245,7 @@ void UnitTestImpl::UnshuffleTests() {
// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
GTEST_NO_INLINE_
GTEST_NO_TAIL_CALL_
std
::
string
GTEST_NO_INLINE_
GTEST_NO_TAIL_CALL_
std
::
string
GetCurrentOsStackTraceExceptTop
(
UnitTest
*
/*unit_test*/
,
int
skip_count
)
{
GetCurrentOsStackTraceExceptTop
(
int
skip_count
)
{
// We pass skip_count + 1 to skip this wrapper function in addition
// We pass skip_count + 1 to skip this wrapper function in addition
// to what the user really wants to skip.
// to what the user really wants to skip.
return
GetUnitTestImpl
()
->
CurrentOsStackTraceExceptTop
(
skip_count
+
1
);
return
GetUnitTestImpl
()
->
CurrentOsStackTraceExceptTop
(
skip_count
+
1
);
...
...
googletest/test/googletest-param-test-test.cc
View file @
7107c441
...
@@ -821,7 +821,7 @@ TEST_F(PREFIX_WITH_MACRO(NamingTestNonParametrized),
...
@@ -821,7 +821,7 @@ TEST_F(PREFIX_WITH_MACRO(NamingTestNonParametrized),
TEST
(
MacroNameing
,
LookupNames
)
{
TEST
(
MacroNameing
,
LookupNames
)
{
std
::
set
<
std
::
string
>
know_suite_names
,
know_test_names
;
std
::
set
<
std
::
string
>
know_suite_names
,
know_test_names
;
auto
ins
=
testing
::
UnitTest
::
GetInstance
();
const
auto
&
ins
=
testing
::
UnitTest
::
GetInstance
();
int
ts
=
0
;
int
ts
=
0
;
while
(
const
testing
::
TestSuite
*
suite
=
ins
->
GetTestSuite
(
ts
++
))
{
while
(
const
testing
::
TestSuite
*
suite
=
ins
->
GetTestSuite
(
ts
++
))
{
know_suite_names
.
insert
(
suite
->
name
());
know_suite_names
.
insert
(
suite
->
name
());
...
@@ -897,7 +897,7 @@ INSTANTIATE_TEST_SUITE_P(CustomParamNameLambda, CustomLambdaNamingTest,
...
@@ -897,7 +897,7 @@ INSTANTIATE_TEST_SUITE_P(CustomParamNameLambda, CustomLambdaNamingTest,
});
});
TEST
(
CustomNamingTest
,
CheckNameRegistry
)
{
TEST
(
CustomNamingTest
,
CheckNameRegistry
)
{
::
testing
::
UnitTest
*
unit_test
=
::
testing
::
UnitTest
::
GetInstance
();
const
auto
&
unit_test
=
::
testing
::
UnitTest
::
GetInstance
();
std
::
set
<
std
::
string
>
test_names
;
std
::
set
<
std
::
string
>
test_names
;
for
(
int
suite_num
=
0
;
suite_num
<
unit_test
->
total_test_suite_count
();
for
(
int
suite_num
=
0
;
suite_num
<
unit_test
->
total_test_suite_count
();
++
suite_num
)
{
++
suite_num
)
{
...
...
googletest/test/gtest-unittest-api_test.cc
View file @
7107c441
...
@@ -106,7 +106,7 @@ const int kTypedTests = 1;
...
@@ -106,7 +106,7 @@ const int kTypedTests = 1;
// Since tests can be run in any order, the values the accessors that track
// Since tests can be run in any order, the values the accessors that track
// test execution (such as failed_test_count) can not be predicted.
// test execution (such as failed_test_count) can not be predicted.
TEST
(
ApiTest
,
UnitTestImmutableAccessorsWork
)
{
TEST
(
ApiTest
,
UnitTestImmutableAccessorsWork
)
{
UnitTest
*
unit_test
=
UnitTest
::
GetInstance
();
const
auto
&
unit_test
=
UnitTest
::
GetInstance
();
ASSERT_EQ
(
2
+
kTypedTestSuites
,
unit_test
->
total_test_suite_count
());
ASSERT_EQ
(
2
+
kTypedTestSuites
,
unit_test
->
total_test_suite_count
());
EXPECT_EQ
(
1
+
kTypedTestSuites
,
unit_test
->
test_suite_to_run_count
());
EXPECT_EQ
(
1
+
kTypedTestSuites
,
unit_test
->
test_suite_to_run_count
());
...
@@ -224,7 +224,7 @@ TEST(DISABLED_Test, Dummy2) {}
...
@@ -224,7 +224,7 @@ TEST(DISABLED_Test, Dummy2) {}
class
FinalSuccessChecker
:
public
Environment
{
class
FinalSuccessChecker
:
public
Environment
{
protected:
protected:
void
TearDown
()
override
{
void
TearDown
()
override
{
UnitTest
*
unit_test
=
UnitTest
::
GetInstance
();
const
auto
&
unit_test
=
UnitTest
::
GetInstance
();
EXPECT_EQ
(
1
+
kTypedTestSuites
,
unit_test
->
successful_test_suite_count
());
EXPECT_EQ
(
1
+
kTypedTestSuites
,
unit_test
->
successful_test_suite_count
());
EXPECT_EQ
(
3
+
kTypedTests
,
unit_test
->
successful_test_count
());
EXPECT_EQ
(
3
+
kTypedTests
,
unit_test
->
successful_test_count
());
...
...
googletest/test/gtest_unittest.cc
View file @
7107c441
...
@@ -7703,7 +7703,7 @@ auto* dynamic_test = testing::RegisterTest(
...
@@ -7703,7 +7703,7 @@ auto* dynamic_test = testing::RegisterTest(
__LINE__
,
[]()
->
DynamicUnitTestFixture
*
{
return
new
DynamicTest
;
});
__LINE__
,
[]()
->
DynamicUnitTestFixture
*
{
return
new
DynamicTest
;
});
TEST
(
RegisterTest
,
WasRegistered
)
{
TEST
(
RegisterTest
,
WasRegistered
)
{
auto
*
unittest
=
testing
::
UnitTest
::
GetInstance
();
const
auto
&
unittest
=
testing
::
UnitTest
::
GetInstance
();
for
(
int
i
=
0
;
i
<
unittest
->
total_test_suite_count
();
++
i
)
{
for
(
int
i
=
0
;
i
<
unittest
->
total_test_suite_count
();
++
i
)
{
auto
*
tests
=
unittest
->
GetTestSuite
(
i
);
auto
*
tests
=
unittest
->
GetTestSuite
(
i
);
if
(
tests
->
name
()
!=
std
::
string
(
"DynamicUnitTestFixture"
))
continue
;
if
(
tests
->
name
()
!=
std
::
string
(
"DynamicUnitTestFixture"
))
continue
;
...
...
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