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
5df87d70
Commit
5df87d70
authored
Apr 02, 2014
by
kosak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export tuple and friends in the ::testing namespace.
parent
a6340420
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
12 deletions
+31
-12
gtest-param-util-generated.h
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
+5
-5
gtest-port.h
include/gtest/internal/gtest-port.h
+20
-1
sample8_unittest.cc
samples/sample8_unittest.cc
+3
-3
gtest-param-test_test.cc
test/gtest-param-test_test.cc
+3
-3
No files found.
include/gtest/internal/gtest-param-util-generated.h
View file @
5df87d70
This diff is collapsed.
Click to expand it.
include/gtest/internal/gtest-param-util-generated.h.pump
View file @
5df87d70
...
...
@@ -39,7 +39,7 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
// and at most $maxtuple arguments in Combine. Please contact
// googletestframework@googlegroups.com if you need more.
// Please note that the number of arguments to Combine is limited
// by the maximum arity of the implementation of t
r1::t
uple which is
// by the maximum arity of the implementation of tuple which is
// currently set at $maxtuple.
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
...
...
@@ -128,9 +128,9 @@ $range k 2..i
template
<
$
for
j
,
[[
typename
T
$
j
]]
>
class
CartesianProductGenerator
$
i
:
public
ParamGeneratorInterface
<
::
std
::
tr1
::
tuple
<
$
for
j
,
[[
T
$
j
]]
>
>
{
:
public
ParamGeneratorInterface
<
::
testing
::
tuple
<
$
for
j
,
[[
T
$
j
]]
>
>
{
public
:
typedef
::
std
::
tr1
::
tuple
<
$
for
j
,
[[
T
$
j
]]
>
ParamType
;
typedef
::
testing
::
tuple
<
$
for
j
,
[[
T
$
j
]]
>
ParamType
;
CartesianProductGenerator
$
i
(
$
for
j
,
[[
const
ParamGenerator
<
T
$
j
>&
g
$
j
]])
:
$
for
j
,
[[
g
$
(
j
)
_
(
g
$
j
)]]
{}
...
...
@@ -269,8 +269,8 @@ class CartesianProductHolder$i {
CartesianProductHolder
$
i
(
$
for
j
,
[[
const
Generator
$
j
&
g
$
j
]])
:
$
for
j
,
[[
g
$
(
j
)
_
(
g
$
j
)]]
{}
template
<
$
for
j
,
[[
typename
T
$
j
]]
>
operator
ParamGenerator
<
::
std
::
tr1
::
tuple
<
$
for
j
,
[[
T
$
j
]]
>
>
()
const
{
return
ParamGenerator
<
::
std
::
tr1
::
tuple
<
$
for
j
,
[[
T
$
j
]]
>
>
(
operator
ParamGenerator
<
::
testing
::
tuple
<
$
for
j
,
[[
T
$
j
]]
>
>
()
const
{
return
ParamGenerator
<
::
testing
::
tuple
<
$
for
j
,
[[
T
$
j
]]
>
>
(
new
CartesianProductGenerator
$
i
<
$
for
j
,
[[
T
$
j
]]
>
(
$
for
j
,[[
...
...
include/gtest/internal/gtest-port.h
View file @
5df87d70
...
...
@@ -640,8 +640,18 @@ struct _RTL_CRITICAL_SECTION;
// To avoid conditional compilation everywhere, we make it
// gtest-port.h's responsibility to #include the header implementing
// tr1/tuple.
// tuple.
// TODO(sbenza): Enable this block to start using std::tuple instead of
// std::tr1::tuple.
#if 0 && GTEST_HAS_STD_TUPLE_
# include <tuple>
# define GTEST_TUPLE_NAMESPACE_ ::std
#endif
#if GTEST_HAS_TR1_TUPLE
# ifndef GTEST_TUPLE_NAMESPACE_
# define GTEST_TUPLE_NAMESPACE_ ::std::tr1
# endif // GTEST_TUPLE_NAMESPACE_
# if GTEST_USE_OWN_TR1_TUPLE
# include "gtest/internal/gtest-tuple.h"
...
...
@@ -952,6 +962,15 @@ namespace testing {
class
Message
;
// Import tuple and friends into the ::testing namespace.
// It is part of our interface, having them in ::testing allows us to change
// their types as needed.
using
GTEST_TUPLE_NAMESPACE_
::
get
;
using
GTEST_TUPLE_NAMESPACE_
::
make_tuple
;
using
GTEST_TUPLE_NAMESPACE_
::
tuple
;
using
GTEST_TUPLE_NAMESPACE_
::
tuple_size
;
using
GTEST_TUPLE_NAMESPACE_
::
tuple_element
;
namespace
internal
{
// A secret type that Google Test users don't know about. It has no
...
...
samples/sample8_unittest.cc
View file @
5df87d70
...
...
@@ -90,7 +90,7 @@ using ::testing::Combine;
// PreCalculatedPrimeTable disabled. We do this by defining fixture which will
// accept different combinations of parameters for instantiating a
// HybridPrimeTable instance.
class
PrimeTableTest
:
public
TestWithParam
<
::
std
::
tr1
::
tuple
<
bool
,
int
>
>
{
class
PrimeTableTest
:
public
TestWithParam
<
::
testing
::
tuple
<
bool
,
int
>
>
{
protected
:
virtual
void
SetUp
()
{
// This can be written as
...
...
@@ -101,8 +101,8 @@ class PrimeTableTest : public TestWithParam< ::std::tr1::tuple<bool, int> > {
//
// once the Google C++ Style Guide allows use of ::std::tr1::tie.
//
bool
force_on_the_fly
=
::
std
::
tr1
::
get
<
0
>
(
GetParam
());
int
max_precalculated
=
::
std
::
tr1
::
get
<
1
>
(
GetParam
());
bool
force_on_the_fly
=
::
testing
::
get
<
0
>
(
GetParam
());
int
max_precalculated
=
::
testing
::
get
<
1
>
(
GetParam
());
table_
=
new
HybridPrimeTable
(
force_on_the_fly
,
max_precalculated
);
}
virtual
void
TearDown
()
{
...
...
test/gtest-param-test_test.cc
View file @
5df87d70
...
...
@@ -64,9 +64,9 @@ using ::testing::ValuesIn;
# if GTEST_HAS_COMBINE
using
::
testing
::
Combine
;
using
::
std
::
tr1
::
get
;
using
::
std
::
tr1
::
make_tuple
;
using
::
std
::
tr1
::
tuple
;
using
::
testing
::
get
;
using
::
testing
::
make_tuple
;
using
::
testing
::
tuple
;
# endif // GTEST_HAS_COMBINE
using
::
testing
::
internal
::
ParamGenerator
;
...
...
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