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
6a26e47c
Commit
6a26e47c
authored
Jan 10, 2018
by
Gennadiy Civil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code merge, upstreaming accumulated changes, cleanup
parent
62dbaa29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
25 deletions
+28
-25
gtest-param-test.h
googletest/include/gtest/gtest-param-test.h
+22
-19
gtest-param-test.h.pump
googletest/include/gtest/gtest-param-test.h.pump
+2
-2
gtest-typed-test.h
googletest/include/gtest/gtest-typed-test.h
+1
-1
gtest-param-util-generated.h
...etest/include/gtest/internal/gtest-param-util-generated.h
+0
-0
gtest-param-util-generated.h.pump
.../include/gtest/internal/gtest-param-util-generated.h.pump
+3
-3
No files found.
googletest/include/gtest/gtest-param-test.h
View file @
6a26e47c
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
//
//
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
//
//
#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
...
@@ -79,7 +80,7 @@ TEST_P(FooTest, HasBlahBlah) {
...
@@ -79,7 +80,7 @@ TEST_P(FooTest, HasBlahBlah) {
// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
// case with any set of parameters you want. Google Test defines a number
// case with any set of parameters you want. Google Test defines a number
// of functions for generating test parameters. They return what we call
// of functions for generating test parameters. They return what we call
// (surprise!) parameter generators. Here is a
summary of them, which
// (surprise!) parameter generators. Here is a summary of them, which
// are all in the testing namespace:
// are all in the testing namespace:
//
//
//
//
...
@@ -268,7 +269,7 @@ internal::ParamGenerator<T> Range(T start, T end) {
...
@@ -268,7 +269,7 @@ internal::ParamGenerator<T> Range(T start, T end) {
// each with C-string values of "foo", "bar", and "baz":
// each with C-string values of "foo", "bar", and "baz":
//
//
// const char* strings[] = {"foo", "bar", "baz"};
// const char* strings[] = {"foo", "bar", "baz"};
// INSTANTIATE_TEST_CASE_P(StringSequence, S
rt
ingTest, ValuesIn(strings));
// INSTANTIATE_TEST_CASE_P(StringSequence, S
tr
ingTest, ValuesIn(strings));
//
//
// This instantiates tests from test case StlStringTest
// This instantiates tests from test case StlStringTest
// each with STL strings with values "a" and "b":
// each with STL strings with values "a" and "b":
...
@@ -1413,24 +1414,26 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
...
@@ -1413,24 +1414,26 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
// alphanumeric characters or underscore. Because PrintToString adds quotes
// alphanumeric characters or underscore. Because PrintToString adds quotes
// to std::string and C strings, it won't work for these types.
// to std::string and C strings, it won't work for these types.
# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
#define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
gtest_##prefix##test_case_name##_EvalGenerator_() { \
static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
return generator; \
const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
} \
return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
(__VA_ARGS__)(info); \
const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
} \
return ::testing::internal::GetParamNameGen<test_case_name::ParamType>( \
__VA_ARGS__)(info); \
} \
static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
::testing::UnitTest::GetInstance()
->parameterized_test_registry().
\
::testing::UnitTest::GetInstance()
\
GetTestCasePatternHolder<test_case_name>(
\
->parameterized_test_registry()
\
#test_case_name,
\
.GetTestCasePatternHolder<test_case_name>(
\
::testing::internal::CodeLocation(
\
#test_case_name,
\
__FILE__, __LINE__))->AddTestCaseInstantiation(
\
::testing::internal::CodeLocation(__FILE__, __LINE__))
\
#prefix,
\
->AddTestCaseInstantiation(
\
>est_##prefix##test_case_name##_EvalGenerator_,
\
#prefix, >est_##prefix##test_case_name##_EvalGenerator_,
\
>est_##prefix##test_case_name##_EvalGenerateName_,
\
>est_##prefix##test_case_name##_EvalGenerateName_, __FILE__,
\
__FILE__,
__LINE__)
__LINE__)
}
// namespace testing
}
// namespace testing
...
...
googletest/include/gtest/gtest-param-test.h.pump
View file @
6a26e47c
...
@@ -78,7 +78,7 @@ TEST_P(FooTest, HasBlahBlah) {
...
@@ -78,7 +78,7 @@ TEST_P(FooTest, HasBlahBlah) {
// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
// case with any set of parameters you want. Google Test defines a number
// case with any set of parameters you want. Google Test defines a number
// of functions for generating test parameters. They return what we call
// of functions for generating test parameters. They return what we call
// (surprise!) parameter generators. Here is a
summary of them, which
// (surprise!) parameter generators. Here is a summary of them, which
// are all in the testing namespace:
// are all in the testing namespace:
//
//
//
//
...
@@ -267,7 +267,7 @@ internal::ParamGenerator<T> Range(T start, T end) {
...
@@ -267,7 +267,7 @@ internal::ParamGenerator<T> Range(T start, T end) {
// each with C-string values of "foo", "bar", and "baz":
// each with C-string values of "foo", "bar", and "baz":
//
//
// const char* strings[] = {"foo", "bar", "baz"};
// const char* strings[] = {"foo", "bar", "baz"};
// INSTANTIATE_TEST_CASE_P(StringSequence, S
rt
ingTest, ValuesIn(strings));
// INSTANTIATE_TEST_CASE_P(StringSequence, S
tr
ingTest, ValuesIn(strings));
//
//
// This instantiates tests from test case StlStringTest
// This instantiates tests from test case StlStringTest
// each with STL strings with values "a" and "b":
// each with STL strings with values "a" and "b":
...
...
googletest/include/gtest/gtest-typed-test.h
View file @
6a26e47c
...
@@ -243,7 +243,7 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
...
@@ -243,7 +243,7 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
} \
} \
static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_ATTRIBUTE_UNUSED_ = \
GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(
\
__FILE__, __LINE__, #__VA_ARGS__)
__FILE__, __LINE__, #__VA_ARGS__)
// The 'Types' template argument below must have spaces around it
// The 'Types' template argument below must have spaces around it
...
...
googletest/include/gtest/internal/gtest-param-util-generated.h
View file @
6a26e47c
This diff is collapsed.
Click to expand it.
googletest/include/gtest/internal/gtest-param-util-generated.h.pump
View file @
6a26e47c
...
@@ -160,7 +160,7 @@ $for k [[
...
@@ -160,7 +160,7 @@ $for k [[
virtual
ParamIteratorInterface
<
ParamType
>*
Clone
()
const
{
virtual
ParamIteratorInterface
<
ParamType
>*
Clone
()
const
{
return
new
Iterator
(
*
this
);
return
new
Iterator
(
*
this
);
}
}
virtual
const
ParamType
*
Current
()
const
{
return
&
current_value_
;
}
virtual
const
ParamType
*
Current
()
const
{
return
current_value_
.
get
()
;
}
virtual
bool
Equals
(
const
ParamIteratorInterface
<
ParamType
>&
other
)
const
{
virtual
bool
Equals
(
const
ParamIteratorInterface
<
ParamType
>&
other
)
const
{
// Having the same base generator guarantees that the other
// Having the same base generator guarantees that the other
// iterator is of the same type and we can downcast.
// iterator is of the same type and we can downcast.
...
@@ -192,7 +192,7 @@ $for k [[
...
@@ -192,7 +192,7 @@ $for k [[
void
ComputeCurrentValue
()
{
void
ComputeCurrentValue
()
{
if
(
!
AtEnd
())
if
(
!
AtEnd
())
current_value_
=
ParamType
(
$
for
j
,
[[
*
current
$
(
j
)
_
]]
);
current_value_
.
reset
(
new
ParamType
(
$
for
j
,
[[
*
current
$
(
j
)
_
]])
);
}
}
bool
AtEnd
()
const
{
bool
AtEnd
()
const
{
// We must report iterator past the end of the range when either of the
// We must report iterator past the end of the range when either of the
...
@@ -217,7 +217,7 @@ $for j [[
...
@@ -217,7 +217,7 @@ $for j [[
typename
ParamGenerator
<
T
$
j
>::
iterator
current
$
(
j
)
_
;
typename
ParamGenerator
<
T
$
j
>::
iterator
current
$
(
j
)
_
;
]]
]]
ParamType
current_value_
;
linked_ptr
<
ParamType
>
current_value_
;
};
// class CartesianProductGenerator$i::Iterator
};
// class CartesianProductGenerator$i::Iterator
// No implementation - assignment is unsupported.
// No implementation - assignment is unsupported.
...
...
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