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
bd018832
Commit
bd018832
authored
Apr 02, 2014
by
kosak
Browse files
Export tuple and friends in the ::testing namespace.
parent
15d61e42
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
306 additions
and
375 deletions
+306
-375
include/gmock/gmock-actions.h
include/gmock/gmock-actions.h
+2
-2
include/gmock/gmock-generated-actions.h
include/gmock/gmock-generated-actions.h
+110
-147
include/gmock/gmock-generated-actions.h.pump
include/gmock/gmock-generated-actions.h.pump
+13
-20
include/gmock/gmock-generated-function-mockers.h
include/gmock/gmock-generated-function-mockers.h
+21
-22
include/gmock/gmock-generated-function-mockers.h.pump
include/gmock/gmock-generated-function-mockers.h.pump
+2
-2
include/gmock/gmock-generated-matchers.h
include/gmock/gmock-generated-matchers.h
+67
-78
include/gmock/gmock-generated-matchers.h.pump
include/gmock/gmock-generated-matchers.h.pump
+8
-10
include/gmock/gmock-matchers.h
include/gmock/gmock-matchers.h
+11
-17
include/gmock/gmock-more-actions.h
include/gmock/gmock-more-actions.h
+8
-8
include/gmock/internal/gmock-generated-internal-utils.h
include/gmock/internal/gmock-generated-internal-utils.h
+33
-33
include/gmock/internal/gmock-generated-internal-utils.h.pump
include/gmock/internal/gmock-generated-internal-utils.h.pump
+4
-4
include/gmock/internal/gmock-internal-utils.h
include/gmock/internal/gmock-internal-utils.h
+3
-5
test/gmock-actions_test.cc
test/gmock-actions_test.cc
+4
-4
test/gmock-generated-actions_test.cc
test/gmock-generated-actions_test.cc
+6
-6
test/gmock-generated-internal-utils_test.cc
test/gmock-generated-internal-utils_test.cc
+1
-1
test/gmock-generated-matchers_test.cc
test/gmock-generated-matchers_test.cc
+5
-5
test/gmock-internal-utils_test.cc
test/gmock-internal-utils_test.cc
+0
-3
test/gmock-matchers_test.cc
test/gmock-matchers_test.cc
+4
-4
test/gmock-more-actions_test.cc
test/gmock-more-actions_test.cc
+4
-4
No files found.
include/gmock/gmock-actions.h
View file @
bd018832
...
@@ -728,7 +728,7 @@ class SetArgumentPointeeAction {
...
@@ -728,7 +728,7 @@ class SetArgumentPointeeAction {
template
<
typename
Result
,
typename
ArgumentTuple
>
template
<
typename
Result
,
typename
ArgumentTuple
>
void
Perform
(
const
ArgumentTuple
&
args
)
const
{
void
Perform
(
const
ArgumentTuple
&
args
)
const
{
CompileAssertTypesEqual
<
void
,
Result
>
();
CompileAssertTypesEqual
<
void
,
Result
>
();
*::
std
::
tr1
::
get
<
N
>
(
args
)
=
value_
;
*::
testing
::
get
<
N
>
(
args
)
=
value_
;
}
}
private:
private:
...
@@ -751,7 +751,7 @@ class SetArgumentPointeeAction<N, Proto, true> {
...
@@ -751,7 +751,7 @@ class SetArgumentPointeeAction<N, Proto, true> {
template
<
typename
Result
,
typename
ArgumentTuple
>
template
<
typename
Result
,
typename
ArgumentTuple
>
void
Perform
(
const
ArgumentTuple
&
args
)
const
{
void
Perform
(
const
ArgumentTuple
&
args
)
const
{
CompileAssertTypesEqual
<
void
,
Result
>
();
CompileAssertTypesEqual
<
void
,
Result
>
();
::
std
::
tr1
::
get
<
N
>
(
args
)
->
CopyFrom
(
*
proto_
);
::
testing
::
get
<
N
>
(
args
)
->
CopyFrom
(
*
proto_
);
}
}
private:
private:
...
...
include/gmock/gmock-generated-actions.h
View file @
bd018832
This diff is collapsed.
Click to expand it.
include/gmock/gmock-generated-actions.h.pump
View file @
bd018832
...
@@ -61,24 +61,20 @@ $range j 1..i
...
@@ -61,24 +61,20 @@ $range j 1..i
$
var
types
=
[[
$
for
j
[[,
typename
A
$
j
]]]]
$
var
types
=
[[
$
for
j
[[,
typename
A
$
j
]]]]
$
var
as
=
[[
$
for
j
,
[[
A
$
j
]]]]
$
var
as
=
[[
$
for
j
,
[[
A
$
j
]]]]
$
var
args
=
[[
$
if
i
==
0
[[]]
$
else
[[
args
]]]]
$
var
args
=
[[
$
if
i
==
0
[[]]
$
else
[[
args
]]]]
$
var
import
=
[[
$
if
i
==
0
[[]]
$
else
[[
using
::
std
::
tr1
::
get
;
]]]]
$
var
gets
=
[[
$
for
j
,
[[
get
<
$
(
j
-
1
)
>
(
args
)]]]]
$
var
gets
=
[[
$
for
j
,
[[
get
<
$
(
j
-
1
)
>
(
args
)]]]]
template
<
typename
R
$
types
>
template
<
typename
R
$
types
>
class
InvokeHelper
<
R
,
::
std
::
tr1
::
tuple
<
$
as
>
>
{
class
InvokeHelper
<
R
,
::
testing
::
tuple
<
$
as
>
>
{
public:
public:
template
<
typename
Function
>
template
<
typename
Function
>
static
R
Invoke
(
Function
function
,
const
::
std
::
tr1
::
tuple
<
$
as
>&
$
args
)
{
static
R
Invoke
(
Function
function
,
const
::
testing
::
tuple
<
$
as
>&
$
args
)
{
$
import
return
function
(
$
gets
);
return
function
(
$
gets
);
}
}
template
<
class
Class
,
typename
MethodPtr
>
template
<
class
Class
,
typename
MethodPtr
>
static
R
InvokeMethod
(
Class
*
obj_ptr
,
static
R
InvokeMethod
(
Class
*
obj_ptr
,
MethodPtr
method_ptr
,
MethodPtr
method_ptr
,
const
::
std
::
tr1
::
tuple
<
$
as
>&
$
args
)
{
const
::
testing
::
tuple
<
$
as
>&
$
args
)
{
$
import
return
(
obj_ptr
->*
method_ptr
)(
$
gets
);
return
(
obj_ptr
->*
method_ptr
)(
$
gets
);
}
}
};
};
...
@@ -141,7 +137,7 @@ $var Ts = [[$for j, [[T$j]]]]
...
@@ -141,7 +137,7 @@ $var Ts = [[$for j, [[T$j]]]]
// An INTERNAL macro for extracting the type of a tuple field. It's
// An INTERNAL macro for extracting the type of a tuple field. It's
// subject to change without notice - DO NOT USE IN USER CODE!
// subject to change without notice - DO NOT USE IN USER CODE!
#define GMOCK_FIELD_(Tuple, N) \
#define GMOCK_FIELD_(Tuple, N) \
typename ::
std::tr1
::tuple_element<N, Tuple>::type
typename ::
testing
::tuple_element<N, Tuple>::type
$
range
i
1.
.
n
$
range
i
1.
.
n
...
@@ -149,15 +145,15 @@ $range i 1..n
...
@@ -149,15 +145,15 @@ $range i 1..n
// type of an n-ary function whose i-th (1-based) argument type is the
// type of an n-ary function whose i-th (1-based) argument type is the
// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
// type, and whose return type is Result. For example,
// type, and whose return type is Result. For example,
// SelectArgs<int, ::
std::tr1
::tuple<bool, char, double, long>, 0, 3>::type
// SelectArgs<int, ::
testing
::tuple<bool, char, double, long>, 0, 3>::type
// is int(bool, long).
// is int(bool, long).
//
//
// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
// For example,
// For example,
// SelectArgs<int,
::std::tr1::
tuple<bool, char, double>, 2, 0>::Select(
// SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
// ::
std::tr1
::make_tuple(true, 'a', 2.5))
// ::
testing
::make_tuple(true, 'a', 2.5))
// returns
::std::tr1::
tuple (2.5, true).
// returns tuple (2.5, true).
//
//
// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
// in the range [0, $n]. Duplicates are allowed and they don't have
// in the range [0, $n]. Duplicates are allowed and they don't have
...
@@ -169,7 +165,6 @@ class SelectArgs {
...
@@ -169,7 +165,6 @@ class SelectArgs {
typedef
Result
type
(
$
for
i
,
[[
GMOCK_FIELD_
(
ArgumentTuple
,
k
$
i
)]]);
typedef
Result
type
(
$
for
i
,
[[
GMOCK_FIELD_
(
ArgumentTuple
,
k
$
i
)]]);
typedef
typename
Function
<
type
>::
ArgumentTuple
SelectedArgs
;
typedef
typename
Function
<
type
>::
ArgumentTuple
SelectedArgs
;
static
SelectedArgs
Select
(
const
ArgumentTuple
&
args
)
{
static
SelectedArgs
Select
(
const
ArgumentTuple
&
args
)
{
using
::
std
::
tr1
::
get
;
return
SelectedArgs
(
$
for
i
,
[[
get
<
k
$
i
>
(
args
)]]);
return
SelectedArgs
(
$
for
i
,
[[
get
<
k
$
i
>
(
args
)]]);
}
}
};
};
...
@@ -186,7 +181,6 @@ class SelectArgs<Result, ArgumentTuple,
...
@@ -186,7 +181,6 @@ class SelectArgs<Result, ArgumentTuple,
typedef
typename
Function
<
type
>::
ArgumentTuple
SelectedArgs
;
typedef
typename
Function
<
type
>::
ArgumentTuple
SelectedArgs
;
static
SelectedArgs
Select
(
const
ArgumentTuple
&
[[]]
static
SelectedArgs
Select
(
const
ArgumentTuple
&
[[]]
$
if
i
==
1
[[
/* args */
]]
$
else
[[
args
]])
{
$
if
i
==
1
[[
/* args */
]]
$
else
[[
args
]])
{
using
::
std
::
tr1
::
get
;
return
SelectedArgs
(
$
for
j1
,
[[
get
<
k
$
j1
>
(
args
)]]);
return
SelectedArgs
(
$
for
j1
,
[[
get
<
k
$
j1
>
(
args
)]]);
}
}
};
};
...
@@ -266,8 +260,7 @@ $range k 1..n-i
...
@@ -266,8 +260,7 @@ $range k 1..n-i
$
var
eas
=
[[
$
for
k
,
[[
ExcessiveArg
()]]]]
$
var
eas
=
[[
$
for
k
,
[[
ExcessiveArg
()]]]]
$
var
arg_list
=
[[
$
if
(
i
==
0
)
|
(
i
==
n
)
[[
$
as
$
eas
]]
$
else
[[
$
as
,
$
eas
]]]]
$
var
arg_list
=
[[
$
if
(
i
==
0
)
|
(
i
==
n
)
[[
$
as
$
eas
]]
$
else
[[
$
as
,
$
eas
]]]]
$
template
$
template
static
Result
Perform
(
Impl
*
impl
,
const
::
std
::
tr1
::
tuple
<
$
As
>
&
args
)
{
static
Result
Perform
(
Impl
*
impl
,
const
::
testing
::
tuple
<
$
As
>
&
args
)
{
using
::
std
::
tr1
::
get
;
return
impl
->
template
gmock_PerformImpl
<
$
As
>(
args
,
$
arg_list
);
return
impl
->
template
gmock_PerformImpl
<
$
As
>(
args
,
$
arg_list
);
}
}
...
@@ -454,7 +447,7 @@ $for k [[, \
...
@@ -454,7 +447,7 @@ $for k [[, \
// ACTION_TEMPLATE(DuplicateArg,
// ACTION_TEMPLATE(DuplicateArg,
// HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
// HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
// AND_1_VALUE_PARAMS(output)) {
// AND_1_VALUE_PARAMS(output)) {
// *output = T(
std::tr1
::get<k>(args));
// *output = T(
::testing
::get<k>(args));
// }
// }
// ...
// ...
// int n;
// int n;
...
@@ -789,7 +782,7 @@ ACTION_TEMPLATE(InvokeArgument,
...
@@ -789,7 +782,7 @@ ACTION_TEMPLATE(InvokeArgument,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_
$
i
[[]]
_VALUE_PARAMS
(
$
for
j
,
[[
p
$
j
]]))
{
AND_
$
i
[[]]
_VALUE_PARAMS
(
$
for
j
,
[[
p
$
j
]]))
{
return
internal
::
CallableHelper
<
return_type
>::
Call
(
return
internal
::
CallableHelper
<
return_type
>::
Call
(
::
std
::
tr1
::
get
<
k
>
(
args
)
$
for
j
[[,
p
$
j
]]);
::
testing
::
get
<
k
>
(
args
)
$
for
j
[[,
p
$
j
]]);
}
}
]]
]]
...
...
include/gmock/gmock-generated-function-mockers.h
View file @
bd018832
...
@@ -85,7 +85,7 @@ class FunctionMocker<R(A1)> : public
...
@@ -85,7 +85,7 @@ class FunctionMocker<R(A1)> : public
typedef
typename
internal
::
Function
<
F
>::
ArgumentTuple
ArgumentTuple
;
typedef
typename
internal
::
Function
<
F
>::
ArgumentTuple
ArgumentTuple
;
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
)
{
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
));
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -106,7 +106,7 @@ class FunctionMocker<R(A1, A2)> : public
...
@@ -106,7 +106,7 @@ class FunctionMocker<R(A1, A2)> : public
typedef
typename
internal
::
Function
<
F
>::
ArgumentTuple
ArgumentTuple
;
typedef
typename
internal
::
Function
<
F
>::
ArgumentTuple
ArgumentTuple
;
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
)
{
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
));
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -128,7 +128,7 @@ class FunctionMocker<R(A1, A2, A3)> : public
...
@@ -128,7 +128,7 @@ class FunctionMocker<R(A1, A2, A3)> : public
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
const
Matcher
<
A3
>&
m3
)
{
const
Matcher
<
A3
>&
m3
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
,
m3
));
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
,
m3
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -150,7 +150,7 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public
...
@@ -150,7 +150,7 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
)
{
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
,
m3
,
m4
));
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
,
m3
,
m4
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -173,8 +173,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
...
@@ -173,8 +173,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
)
{
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
));
m5
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -198,7 +197,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
...
@@ -198,7 +197,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A6
>&
m6
)
{
const
Matcher
<
A6
>&
m6
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
m6
));
m6
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -223,7 +222,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
...
@@ -223,7 +222,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A6
>&
m6
,
const
Matcher
<
A7
>&
m7
)
{
const
Matcher
<
A6
>&
m6
,
const
Matcher
<
A7
>&
m7
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
m6
,
m7
));
m6
,
m7
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -248,7 +247,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
...
@@ -248,7 +247,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
MockSpec
<
F
>&
With
(
const
Matcher
<
A1
>&
m1
,
const
Matcher
<
A2
>&
m2
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A6
>&
m6
,
const
Matcher
<
A7
>&
m7
,
const
Matcher
<
A8
>&
m8
)
{
const
Matcher
<
A6
>&
m6
,
const
Matcher
<
A7
>&
m7
,
const
Matcher
<
A8
>&
m8
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
m6
,
m7
,
m8
));
m6
,
m7
,
m8
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -274,7 +273,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
...
@@ -274,7 +273,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A6
>&
m6
,
const
Matcher
<
A7
>&
m7
,
const
Matcher
<
A8
>&
m8
,
const
Matcher
<
A6
>&
m6
,
const
Matcher
<
A7
>&
m7
,
const
Matcher
<
A8
>&
m8
,
const
Matcher
<
A9
>&
m9
)
{
const
Matcher
<
A9
>&
m9
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
m6
,
m7
,
m8
,
m9
));
m6
,
m7
,
m8
,
m9
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -301,7 +300,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
...
@@ -301,7 +300,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A3
>&
m3
,
const
Matcher
<
A4
>&
m4
,
const
Matcher
<
A5
>&
m5
,
const
Matcher
<
A6
>&
m6
,
const
Matcher
<
A7
>&
m7
,
const
Matcher
<
A8
>&
m8
,
const
Matcher
<
A6
>&
m6
,
const
Matcher
<
A7
>&
m7
,
const
Matcher
<
A8
>&
m8
,
const
Matcher
<
A9
>&
m9
,
const
Matcher
<
A10
>&
m10
)
{
const
Matcher
<
A9
>&
m9
,
const
Matcher
<
A10
>&
m10
)
{
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
m1
,
m2
,
m3
,
m4
,
m5
,
m6
,
m7
,
m8
,
m9
,
m10
));
m6
,
m7
,
m8
,
m9
,
m10
));
return
this
->
current_spec
();
return
this
->
current_spec
();
}
}
...
@@ -353,7 +352,7 @@ using internal::FunctionMocker;
...
@@ -353,7 +352,7 @@ using internal::FunctionMocker;
#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
) constness { \
) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 0), \
== 0), \
this_method_does_not_take_0_arguments); \
this_method_does_not_take_0_arguments); \
...
@@ -372,7 +371,7 @@ using internal::FunctionMocker;
...
@@ -372,7 +371,7 @@ using internal::FunctionMocker;
#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 1), \
== 1), \
this_method_does_not_take_1_argument); \
this_method_does_not_take_1_argument); \
...
@@ -392,7 +391,7 @@ using internal::FunctionMocker;
...
@@ -392,7 +391,7 @@ using internal::FunctionMocker;
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 2), \
== 2), \
this_method_does_not_take_2_arguments); \
this_method_does_not_take_2_arguments); \
...
@@ -414,7 +413,7 @@ using internal::FunctionMocker;
...
@@ -414,7 +413,7 @@ using internal::FunctionMocker;
GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 3), \
== 3), \
this_method_does_not_take_3_arguments); \
this_method_does_not_take_3_arguments); \
...
@@ -440,7 +439,7 @@ using internal::FunctionMocker;
...
@@ -440,7 +439,7 @@ using internal::FunctionMocker;
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 4), \
== 4), \
this_method_does_not_take_4_arguments); \
this_method_does_not_take_4_arguments); \
...
@@ -468,7 +467,7 @@ using internal::FunctionMocker;
...
@@ -468,7 +467,7 @@ using internal::FunctionMocker;
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 5), \
== 5), \
this_method_does_not_take_5_arguments); \
this_method_does_not_take_5_arguments); \
...
@@ -498,7 +497,7 @@ using internal::FunctionMocker;
...
@@ -498,7 +497,7 @@ using internal::FunctionMocker;
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 6), \
== 6), \
this_method_does_not_take_6_arguments); \
this_method_does_not_take_6_arguments); \
...
@@ -530,7 +529,7 @@ using internal::FunctionMocker;
...
@@ -530,7 +529,7 @@ using internal::FunctionMocker;
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 7), \
== 7), \
this_method_does_not_take_7_arguments); \
this_method_does_not_take_7_arguments); \
...
@@ -564,7 +563,7 @@ using internal::FunctionMocker;
...
@@ -564,7 +563,7 @@ using internal::FunctionMocker;
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 8), \
== 8), \
this_method_does_not_take_8_arguments); \
this_method_does_not_take_8_arguments); \
...
@@ -600,7 +599,7 @@ using internal::FunctionMocker;
...
@@ -600,7 +599,7 @@ using internal::FunctionMocker;
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 9), \
== 9), \
this_method_does_not_take_9_arguments); \
this_method_does_not_take_9_arguments); \
...
@@ -640,7 +639,7 @@ using internal::FunctionMocker;
...
@@ -640,7 +639,7 @@ using internal::FunctionMocker;
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
== 10), \
== 10), \
this_method_does_not_take_10_arguments); \
this_method_does_not_take_10_arguments); \
...
...
include/gmock/gmock-generated-function-mockers.h.pump
View file @
bd018832
...
@@ -78,7 +78,7 @@ class FunctionMocker<R($As)> : public
...
@@ -78,7 +78,7 @@ class FunctionMocker<R($As)> : public
MockSpec
<
F
>&
With
(
$
matchers
)
{
MockSpec
<
F
>&
With
(
$
matchers
)
{
$
if
i
>=
1
[[
$
if
i
>=
1
[[
this
->
current_spec
().
SetMatchers
(
::
std
::
tr1
::
make_tuple
(
$
ms
));
this
->
current_spec
().
SetMatchers
(
::
testing
::
make_tuple
(
$
ms
));
]]
]]
return
this
->
current_spec
();
return
this
->
current_spec
();
...
@@ -139,7 +139,7 @@ $var matcher_as = [[$for j, \
...
@@ -139,7 +139,7 @@ $var matcher_as = [[$for j, \
#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \
#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
$arg_as) constness { \
$arg_as) constness { \
GTEST_COMPILE_ASSERT_((::
std::tr1
::tuple_size< \
GTEST_COMPILE_ASSERT_((::
testing
::tuple_size< \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \
this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \
this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \
GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \
GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \
...
...
include/gmock/gmock-generated-matchers.h
View file @
bd018832
This diff is collapsed.
Click to expand it.
include/gmock/gmock-generated-matchers.h.pump
View file @
bd018832
...
@@ -53,7 +53,7 @@ $range i 0..n-1
...
@@ -53,7 +53,7 @@ $range i 0..n-1
// The type of the i-th (0-based) field of Tuple.
// The type of the i-th (0-based) field of Tuple.
#define GMOCK_FIELD_TYPE_(Tuple, i) \
#define GMOCK_FIELD_TYPE_(Tuple, i) \
typename ::
std::tr1
::tuple_element<i, Tuple>::type
typename ::
testing
::tuple_element<i, Tuple>::type
// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
// tuple of type Tuple. It has two members:
// tuple of type Tuple. It has two members:
...
@@ -73,9 +73,8 @@ class TupleFields;
...
@@ -73,9 +73,8 @@ class TupleFields;
template
<
class
Tuple
$
for
i
[[,
int
k
$
i
]]>
template
<
class
Tuple
$
for
i
[[,
int
k
$
i
]]>
class
TupleFields
{
class
TupleFields
{
public:
public:
typedef
::
std
::
tr1
::
tuple
<
$
for
i
,
[[
GMOCK_FIELD_TYPE_
(
Tuple
,
k
$
i
)]]
>
type
;
typedef
::
testing
::
tuple
<
$
for
i
,
[[
GMOCK_FIELD_TYPE_
(
Tuple
,
k
$
i
)]]
>
type
;
static
type
GetSelectedFields
(
const
Tuple
&
t
)
{
static
type
GetSelectedFields
(
const
Tuple
&
t
)
{
using
::
std
::
tr1
::
get
;
return
type
(
$
for
i
,
[[
get
<
k
$
i
>
(
t
)]]);
return
type
(
$
for
i
,
[[
get
<
k
$
i
>
(
t
)]]);
}
}
};
};
...
@@ -90,9 +89,8 @@ $range k 0..n-1
...
@@ -90,9 +89,8 @@ $range k 0..n-1
template
<
class
Tuple
$
for
j
[[,
int
k
$
j
]]>
template
<
class
Tuple
$
for
j
[[,
int
k
$
j
]]>
class
TupleFields
<
Tuple
,
$
for
k
,
[[
$
if
k
<
i
[[
k
$
k
]]
$
else
[[
-
1
]]]]
>
{
class
TupleFields
<
Tuple
,
$
for
k
,
[[
$
if
k
<
i
[[
k
$
k
]]
$
else
[[
-
1
]]]]
>
{
public:
public:
typedef
::
std
::
tr1
::
tuple
<
$
for
j
,
[[
GMOCK_FIELD_TYPE_
(
Tuple
,
k
$
j
)]]
>
type
;
typedef
::
testing
::
tuple
<
$
for
j
,
[[
GMOCK_FIELD_TYPE_
(
Tuple
,
k
$
j
)]]
>
type
;
static
type
GetSelectedFields
(
const
Tuple
&
$
if
i
==
0
[[
/* t */
]]
$
else
[[
t
]])
{
static
type
GetSelectedFields
(
const
Tuple
&
$
if
i
==
0
[[
/* t */
]]
$
else
[[
t
]])
{
using
::
std
::
tr1
::
get
;
return
type
(
$
for
j
,
[[
get
<
k
$
j
>
(
t
)]]);
return
type
(
$
for
j
,
[[
get
<
k
$
j
>
(
t
)]]);
}
}
};
};
...
@@ -289,12 +287,12 @@ template <$for j, [[typename T$j]]>
...
@@ -289,12 +287,12 @@ template <$for j, [[typename T$j]]>
]]
]]
inline
internal
::
ElementsAreMatcher
<
inline
internal
::
ElementsAreMatcher
<
std
::
tr1
::
tuple
<
::
testing
::
tuple
<
$
for
j
,
[[
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
>
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
>
ElementsAre
(
$
for
j
,
[[
const
T
$
j
&
e
$
j
]])
{
ElementsAre
(
$
for
j
,
[[
const
T
$
j
&
e
$
j
]])
{
typedef
std
::
tr1
::
tuple
<
typedef
::
testing
::
tuple
<
$
for
j
,
[[
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
Args
;
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
Args
;
...
@@ -317,12 +315,12 @@ template <$for j, [[typename T$j]]>
...
@@ -317,12 +315,12 @@ template <$for j, [[typename T$j]]>
]]
]]
inline
internal
::
UnorderedElementsAreMatcher
<
inline
internal
::
UnorderedElementsAreMatcher
<
std
::
tr1
::
tuple
<
::
testing
::
tuple
<
$
for
j
,
[[
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
>
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
>
UnorderedElementsAre
(
$
for
j
,
[[
const
T
$
j
&
e
$
j
]])
{
UnorderedElementsAre
(
$
for
j
,
[[
const
T
$
j
&
e
$
j
]])
{
typedef
std
::
tr1
::
tuple
<
typedef
::
testing
::
tuple
<
$
for
j
,
[[
$
for
j
,
[[
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
Args
;
typename
internal
::
DecayArray
<
T
$
j
[[]]
>::
type
]]
>
Args
;
...
@@ -646,7 +644,7 @@ $var param_field_decls2 = [[$for j
...
@@ -646,7 +644,7 @@ $var param_field_decls2 = [[$for j
return
::
testing
::
internal
::
FormatMatcherDescription
(
\
return
::
testing
::
internal
::
FormatMatcherDescription
(
\
negation
,
#
name
,
\
negation
,
#
name
,
\
::
testing
::
internal
::
UniversalTersePrintTupleFieldsToStrings
(
\
::
testing
::
internal
::
UniversalTersePrintTupleFieldsToStrings
(
\
::
std
::
tr1
::
tuple
<
$
for
j
,
[[
p
$
j
##
_type
]]
>
(
$
for
j
,
[[
p
$
j
]])));
\
::
testing
::
tuple
<
$
for
j
,
[[
p
$
j
##
_type
]]
>
(
$
for
j
,
[[
p
$
j
]])));
\
}
\
}
\
GTEST_DISALLOW_ASSIGN_
(
gmock_Impl
);
\
GTEST_DISALLOW_ASSIGN_
(
gmock_Impl
);
\
};
\
};
\
...
...
include/gmock/gmock-matchers.h
View file @
bd018832
...
@@ -706,7 +706,6 @@ class TuplePrefix {
...
@@ -706,7 +706,6 @@ class TuplePrefix {
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
static
bool
Matches
(
const
MatcherTuple
&
matcher_tuple
,
static
bool
Matches
(
const
MatcherTuple
&
matcher_tuple
,
const
ValueTuple
&
value_tuple
)
{
const
ValueTuple
&
value_tuple
)
{
using
::
std
::
tr1
::
get
;
return
TuplePrefix
<
N
-
1
>::
Matches
(
matcher_tuple
,
value_tuple
)
return
TuplePrefix
<
N
-
1
>::
Matches
(
matcher_tuple
,
value_tuple
)
&&
get
<
N
-
1
>
(
matcher_tuple
).
Matches
(
get
<
N
-
1
>
(
value_tuple
));
&&
get
<
N
-
1
>
(
matcher_tuple
).
Matches
(
get
<
N
-
1
>
(
value_tuple
));
}
}
...
@@ -719,9 +718,6 @@ class TuplePrefix {
...
@@ -719,9 +718,6 @@ class TuplePrefix {
static
void
ExplainMatchFailuresTo
(
const
MatcherTuple
&
matchers
,
static
void
ExplainMatchFailuresTo
(
const
MatcherTuple
&
matchers
,
const
ValueTuple
&
values
,
const
ValueTuple
&
values
,
::
std
::
ostream
*
os
)
{
::
std
::
ostream
*
os
)
{
using
::
std
::
tr1
::
tuple_element
;
using
::
std
::
tr1
::
get
;
// First, describes failures in the first N - 1 fields.
// First, describes failures in the first N - 1 fields.
TuplePrefix
<
N
-
1
>::
ExplainMatchFailuresTo
(
matchers
,
values
,
os
);
TuplePrefix
<
N
-
1
>::
ExplainMatchFailuresTo
(
matchers
,
values
,
os
);
...
@@ -774,7 +770,6 @@ class TuplePrefix<0> {
...
@@ -774,7 +770,6 @@ class TuplePrefix<0> {
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
template
<
typename
MatcherTuple
,
typename
ValueTuple
>
bool
TupleMatches
(
const
MatcherTuple
&
matcher_tuple
,
bool
TupleMatches
(
const
MatcherTuple
&
matcher_tuple
,
const
ValueTuple
&
value_tuple
)
{
const
ValueTuple
&
value_tuple
)
{
using
::
std
::
tr1
::
tuple_size
;
// Makes sure that matcher_tuple and value_tuple have the same
// Makes sure that matcher_tuple and value_tuple have the same
// number of fields.
// number of fields.
GTEST_COMPILE_ASSERT_
(
tuple_size
<
MatcherTuple
>::
value
==
GTEST_COMPILE_ASSERT_
(
tuple_size
<
MatcherTuple
>::
value
==
...
@@ -790,7 +785,6 @@ template <typename MatcherTuple, typename ValueTuple>
...
@@ -790,7 +785,6 @@ template <typename MatcherTuple, typename ValueTuple>
void
ExplainMatchFailureTupleTo
(
const
MatcherTuple
&
matchers
,
void
ExplainMatchFailureTupleTo
(
const
MatcherTuple
&
matchers
,
const
ValueTuple
&
values
,
const
ValueTuple
&
values
,
::
std
::
ostream
*
os
)
{
::
std
::
ostream
*
os
)
{
using
::
std
::
tr1
::
tuple_size
;
TuplePrefix
<
tuple_size
<
MatcherTuple
>::
value
>::
ExplainMatchFailuresTo
(
TuplePrefix
<
tuple_size
<
MatcherTuple
>::
value
>::
ExplainMatchFailuresTo
(
matchers
,
values
,
os
);
matchers
,
values
,
os
);
}
}
...
@@ -802,7 +796,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
...
@@ -802,7 +796,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
template
<
typename
Tuple
,
typename
Func
,
typename
OutIter
>
template
<
typename
Tuple
,
typename
Func
,
typename
OutIter
>
class
TransformTupleValuesHelper
{
class
TransformTupleValuesHelper
{
private:
private:
typedef
typename
::
std
::
tr1
::
tuple_size
<
Tuple
>
TupleSize
;
typedef
::
testing
::
tuple_size
<
Tuple
>
TupleSize
;
public:
public:
// For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
// For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
...
@@ -815,7 +809,7 @@ class TransformTupleValuesHelper {
...
@@ -815,7 +809,7 @@ class TransformTupleValuesHelper {
template
<
typename
Tup
,
size_t
kRemainingSize
>
template
<
typename
Tup
,
size_t
kRemainingSize
>
struct
IterateOverTuple
{
struct
IterateOverTuple
{
OutIter
operator
()
(
Func
f
,
const
Tup
&
t
,
OutIter
out
)
const
{
OutIter
operator
()
(
Func
f
,
const
Tup
&
t
,
OutIter
out
)
const
{
*
out
++
=
f
(
::
std
::
tr1
::
get
<
TupleSize
::
value
-
kRemainingSize
>
(
t
));
*
out
++
=
f
(
::
testing
::
get
<
TupleSize
::
value
-
kRemainingSize
>
(
t
));
return
IterateOverTuple
<
Tup
,
kRemainingSize
-
1
>
()(
f
,
t
,
out
);
return
IterateOverTuple
<
Tup
,
kRemainingSize
-
1
>
()(
f
,
t
,
out
);
}
}
};
};
...
@@ -1322,12 +1316,12 @@ class MatchesRegexMatcher {
...
@@ -1322,12 +1316,12 @@ class MatchesRegexMatcher {
class name##2Matcher { \
class name##2Matcher { \
public: \
public: \
template <typename T1, typename T2> \
template <typename T1, typename T2> \
operator Matcher< ::
std::tr1
::tuple<T1, T2> >() const { \
operator Matcher< ::
testing
::tuple<T1, T2> >() const { \
return MakeMatcher(new Impl< ::
std::tr1
::tuple<T1, T2> >); \
return MakeMatcher(new Impl< ::
testing
::tuple<T1, T2> >); \
} \
} \
template <typename T1, typename T2> \
template <typename T1, typename T2> \
operator Matcher<const ::
std::tr1
::tuple<T1, T2>&>() const { \
operator Matcher<const ::
testing
::tuple<T1, T2>&>() const { \
return MakeMatcher(new Impl<const ::
std::tr1
::tuple<T1, T2>&>); \
return MakeMatcher(new Impl<const ::
testing
::tuple<T1, T2>&>); \
} \
} \
private: \
private: \
template <typename Tuple> \
template <typename Tuple> \
...
@@ -1336,10 +1330,10 @@ class MatchesRegexMatcher {
...
@@ -1336,10 +1330,10 @@ class MatchesRegexMatcher {
virtual bool MatchAndExplain( \
virtual bool MatchAndExplain( \
Tuple args, \
Tuple args, \
MatchResultListener*
/* listener */
) const { \
MatchResultListener*
/* listener */
) const { \
return ::
std::tr1
::get<0>(args) op ::
std::tr1
::get<1>(args); \
return ::
testing
::get<0>(args) op ::
testing
::get<1>(args); \
} \
} \
virtual void DescribeTo(::std::ostream* os) const { \
virtual void DescribeTo(::std::ostream* os) const { \
*os << "are " relation;
\
*os << "are " relation; \
} \
} \
virtual void DescribeNegationTo(::std::ostream* os) const { \
virtual void DescribeNegationTo(::std::ostream* os) const { \
*os << "aren't " relation; \
*os << "aren't " relation; \
...
@@ -2543,7 +2537,7 @@ class PointwiseMatcher {
...
@@ -2543,7 +2537,7 @@ class PointwiseMatcher {
// reference, as they may be expensive to copy. We must use tuple
// reference, as they may be expensive to copy. We must use tuple
// instead of pair here, as a pair cannot hold references (C++ 98,
// instead of pair here, as a pair cannot hold references (C++ 98,
// 20.2.2 [lib.pairs]).
// 20.2.2 [lib.pairs]).
typedef
::
std
::
tr1
::
tuple
<
const
LhsValue
&
,
const
RhsValue
&>
InnerMatcherArg
;
typedef
::
testing
::
tuple
<
const
LhsValue
&
,
const
RhsValue
&>
InnerMatcherArg
;
Impl
(
const
TupleMatcher
&
tuple_matcher
,
const
RhsStlContainer
&
rhs
)
Impl
(
const
TupleMatcher
&
tuple_matcher
,
const
RhsStlContainer
&
rhs
)
// mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
// mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
...
@@ -3280,7 +3274,7 @@ class UnorderedElementsAreMatcher {
...
@@ -3280,7 +3274,7 @@ class UnorderedElementsAreMatcher {
typedef
typename
View
::
value_type
Element
;
typedef
typename
View
::
value_type
Element
;
typedef
::
std
::
vector
<
Matcher
<
const
Element
&>
>
MatcherVec
;
typedef
::
std
::
vector
<
Matcher
<
const
Element
&>
>
MatcherVec
;
MatcherVec
matchers
;
MatcherVec
matchers
;
matchers
.
reserve
(
::
std
::
tr1
::
tuple_size
<
MatcherTuple
>::
value
);
matchers
.
reserve
(
::
testing
::
tuple_size
<
MatcherTuple
>::
value
);
TransformTupleValues
(
CastAndAppendTransform
<
const
Element
&>
(),
matchers_
,
TransformTupleValues
(
CastAndAppendTransform
<
const
Element
&>
(),
matchers_
,
::
std
::
back_inserter
(
matchers
));
::
std
::
back_inserter
(
matchers
));
return
MakeMatcher
(
new
UnorderedElementsAreMatcherImpl
<
Container
>
(
return
MakeMatcher
(
new
UnorderedElementsAreMatcherImpl
<
Container
>
(
...
@@ -3305,7 +3299,7 @@ class ElementsAreMatcher {
...
@@ -3305,7 +3299,7 @@ class ElementsAreMatcher {
typedef
typename
View
::
value_type
Element
;
typedef
typename
View
::
value_type
Element
;
typedef
::
std
::
vector
<
Matcher
<
const
Element
&>
>
MatcherVec
;
typedef
::
std
::
vector
<
Matcher
<
const
Element
&>
>
MatcherVec
;
MatcherVec
matchers
;
MatcherVec
matchers
;
matchers
.
reserve
(
::
std
::
tr1
::
tuple_size
<
MatcherTuple
>::
value
);
matchers
.
reserve
(
::
testing
::
tuple_size
<
MatcherTuple
>::
value
);
TransformTupleValues
(
CastAndAppendTransform
<
const
Element
&>
(),
matchers_
,
TransformTupleValues
(
CastAndAppendTransform
<
const
Element
&>
(),
matchers_
,
::
std
::
back_inserter
(
matchers
));
::
std
::
back_inserter
(
matchers
));
return
MakeMatcher
(
new
ElementsAreMatcherImpl
<
Container
>
(
return
MakeMatcher
(
new
ElementsAreMatcherImpl
<
Container
>
(
...
...
include/gmock/gmock-more-actions.h
View file @
bd018832
...
@@ -158,7 +158,7 @@ WithArg(const InnerAction& action) {
...
@@ -158,7 +158,7 @@ WithArg(const InnerAction& action) {
ACTION_TEMPLATE
(
ReturnArg
,
ACTION_TEMPLATE
(
ReturnArg
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_0_VALUE_PARAMS
())
{
AND_0_VALUE_PARAMS
())
{
return
std
::
tr1
::
get
<
k
>
(
args
);
return
::
testing
::
get
<
k
>
(
args
);
}
}
// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
...
@@ -166,7 +166,7 @@ ACTION_TEMPLATE(ReturnArg,
...
@@ -166,7 +166,7 @@ ACTION_TEMPLATE(ReturnArg,
ACTION_TEMPLATE
(
SaveArg
,
ACTION_TEMPLATE
(
SaveArg
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_1_VALUE_PARAMS
(
pointer
))
{
AND_1_VALUE_PARAMS
(
pointer
))
{
*
pointer
=
::
std
::
tr1
::
get
<
k
>
(
args
);
*
pointer
=
::
testing
::
get
<
k
>
(
args
);
}
}
// Action SaveArgPointee<k>(pointer) saves the value pointed to
// Action SaveArgPointee<k>(pointer) saves the value pointed to
...
@@ -174,7 +174,7 @@ ACTION_TEMPLATE(SaveArg,
...
@@ -174,7 +174,7 @@ ACTION_TEMPLATE(SaveArg,
ACTION_TEMPLATE
(
SaveArgPointee
,
ACTION_TEMPLATE
(
SaveArgPointee
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_1_VALUE_PARAMS
(
pointer
))
{
AND_1_VALUE_PARAMS
(
pointer
))
{
*
pointer
=
*::
std
::
tr1
::
get
<
k
>
(
args
);
*
pointer
=
*::
testing
::
get
<
k
>
(
args
);
}
}
// Action SetArgReferee<k>(value) assigns 'value' to the variable
// Action SetArgReferee<k>(value) assigns 'value' to the variable
...
@@ -182,13 +182,13 @@ ACTION_TEMPLATE(SaveArgPointee,
...
@@ -182,13 +182,13 @@ ACTION_TEMPLATE(SaveArgPointee,
ACTION_TEMPLATE
(
SetArgReferee
,
ACTION_TEMPLATE
(
SetArgReferee
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_1_VALUE_PARAMS
(
value
))
{
AND_1_VALUE_PARAMS
(
value
))
{
typedef
typename
::
std
::
tr1
::
tuple_element
<
k
,
args_type
>::
type
argk_type
;
typedef
typename
::
testing
::
tuple_element
<
k
,
args_type
>::
type
argk_type
;
// Ensures that argument #k is a reference. If you get a compiler
// Ensures that argument #k is a reference. If you get a compiler
// error on the next line, you are using SetArgReferee<k>(value) in
// error on the next line, you are using SetArgReferee<k>(value) in
// a mock function whose k-th (0-based) argument is not a reference.
// a mock function whose k-th (0-based) argument is not a reference.
GTEST_COMPILE_ASSERT_
(
internal
::
is_reference
<
argk_type
>::
value
,
GTEST_COMPILE_ASSERT_
(
internal
::
is_reference
<
argk_type
>::
value
,
SetArgReferee_must_be_used_with_a_reference_argument
);
SetArgReferee_must_be_used_with_a_reference_argument
);
::
std
::
tr1
::
get
<
k
>
(
args
)
=
value
;
::
testing
::
get
<
k
>
(
args
)
=
value
;
}
}
// Action SetArrayArgument<k>(first, last) copies the elements in
// Action SetArrayArgument<k>(first, last) copies the elements in
...
@@ -201,9 +201,9 @@ ACTION_TEMPLATE(SetArrayArgument,
...
@@ -201,9 +201,9 @@ ACTION_TEMPLATE(SetArrayArgument,
AND_2_VALUE_PARAMS
(
first
,
last
))
{
AND_2_VALUE_PARAMS
(
first
,
last
))
{
// Visual Studio deprecates ::std::copy, so we use our own copy in that case.
// Visual Studio deprecates ::std::copy, so we use our own copy in that case.
#ifdef _MSC_VER
#ifdef _MSC_VER
internal
::
CopyElements
(
first
,
last
,
::
std
::
tr1
::
get
<
k
>
(
args
));
internal
::
CopyElements
(
first
,
last
,
::
testing
::
get
<
k
>
(
args
));
#else
#else
::
std
::
copy
(
first
,
last
,
::
std
::
tr1
::
get
<
k
>
(
args
));
::
std
::
copy
(
first
,
last
,
::
testing
::
get
<
k
>
(
args
));
#endif
#endif
}
}
...
@@ -212,7 +212,7 @@ ACTION_TEMPLATE(SetArrayArgument,
...
@@ -212,7 +212,7 @@ ACTION_TEMPLATE(SetArrayArgument,
ACTION_TEMPLATE
(
DeleteArg
,
ACTION_TEMPLATE
(
DeleteArg
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_0_VALUE_PARAMS
())
{
AND_0_VALUE_PARAMS
())
{
delete
::
std
::
tr1
::
get
<
k
>
(
args
);
delete
::
testing
::
get
<
k
>
(
args
);
}
}
// This action returns the value pointed to by 'pointer'.
// This action returns the value pointed to by 'pointer'.
...
...
include/gmock/internal/gmock-generated-internal-utils.h
View file @
bd018832
...
@@ -69,70 +69,70 @@ template <typename Tuple>
...
@@ -69,70 +69,70 @@ template <typename Tuple>
struct
MatcherTuple
;
struct
MatcherTuple
;
template
<
>
template
<
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<>
>
{
typedef
::
std
::
tr1
::
tuple
<
>
type
;
typedef
::
testing
::
tuple
<
>
type
;
};
};
template
<
typename
A1
>
template
<
typename
A1
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
>
type
;
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
>
template
<
typename
A1
,
typename
A2
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
>
type
;
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
,
typename
A3
>
template
<
typename
A1
,
typename
A2
,
typename
A3
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
,
A3
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
>
type
;
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
>
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
>
type
;
Matcher
<
A4
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
>
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
Matcher
<
A5
>
>
type
;
Matcher
<
A5
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
typename
A6
>
typename
A6
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
Matcher
<
A5
>
,
Matcher
<
A6
>
>
type
;
Matcher
<
A5
>
,
Matcher
<
A6
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
typename
A6
,
typename
A7
>
typename
A6
,
typename
A7
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
Matcher
<
A5
>
,
Matcher
<
A6
>
,
Matcher
<
A7
>
>
type
;
Matcher
<
A5
>
,
Matcher
<
A6
>
,
Matcher
<
A7
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
typename
A6
,
typename
A7
,
typename
A8
>
typename
A6
,
typename
A7
,
typename
A8
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
Matcher
<
A5
>
,
Matcher
<
A6
>
,
Matcher
<
A7
>
,
Matcher
<
A8
>
>
type
;
Matcher
<
A5
>
,
Matcher
<
A6
>
,
Matcher
<
A7
>
,
Matcher
<
A8
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
typename
A6
,
typename
A7
,
typename
A8
,
typename
A9
>
typename
A6
,
typename
A7
,
typename
A8
,
typename
A9
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
Matcher
<
A5
>
,
Matcher
<
A6
>
,
Matcher
<
A7
>
,
Matcher
<
A8
>
,
Matcher
<
A9
>
>
type
;
Matcher
<
A5
>
,
Matcher
<
A6
>
,
Matcher
<
A7
>
,
Matcher
<
A8
>
,
Matcher
<
A9
>
>
type
;
};
};
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
template
<
typename
A1
,
typename
A2
,
typename
A3
,
typename
A4
,
typename
A5
,
typename
A6
,
typename
A7
,
typename
A8
,
typename
A9
,
typename
A10
>
typename
A6
,
typename
A7
,
typename
A8
,
typename
A9
,
typename
A10
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
,
struct
MatcherTuple
<
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
,
A10
>
>
{
A10
>
>
{
typedef
::
std
::
tr1
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
typedef
::
testing
::
tuple
<
Matcher
<
A1
>
,
Matcher
<
A2
>
,
Matcher
<
A3
>
,
Matcher
<
A4
>
,
Matcher
<
A5
>
,
Matcher
<
A6
>
,
Matcher
<
A7
>
,
Matcher
<
A8
>
,
Matcher
<
A9
>
,
Matcher
<
A5
>
,
Matcher
<
A6
>
,
Matcher
<
A7
>
,
Matcher
<
A8
>
,
Matcher
<
A9
>
,
Matcher
<
A10
>
>
type
;
Matcher
<
A10
>
>
type
;
};
};
...
@@ -156,7 +156,7 @@ struct Function;
...
@@ -156,7 +156,7 @@ struct Function;
template
<
typename
R
>
template
<
typename
R
>
struct
Function
<
R
()
>
{
struct
Function
<
R
()
>
{
typedef
R
Result
;
typedef
R
Result
;
typedef
::
std
::
tr1
::
tuple
<>
ArgumentTuple
;
typedef
::
testing
::
tuple
<>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
();
typedef
void
MakeResultVoid
();
typedef
IgnoredValue
MakeResultIgnoredValue
();
typedef
IgnoredValue
MakeResultIgnoredValue
();
...
@@ -166,7 +166,7 @@ template <typename R, typename A1>
...
@@ -166,7 +166,7 @@ template <typename R, typename A1>
struct
Function
<
R
(
A1
)
>
struct
Function
<
R
(
A1
)
>
:
Function
<
R
()
>
{
:
Function
<
R
()
>
{
typedef
A1
Argument1
;
typedef
A1
Argument1
;
typedef
::
std
::
tr1
::
tuple
<
A1
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
);
typedef
void
MakeResultVoid
(
A1
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
);
...
@@ -176,7 +176,7 @@ template <typename R, typename A1, typename A2>
...
@@ -176,7 +176,7 @@ template <typename R, typename A1, typename A2>
struct
Function
<
R
(
A1
,
A2
)
>
struct
Function
<
R
(
A1
,
A2
)
>
:
Function
<
R
(
A1
)
>
{
:
Function
<
R
(
A1
)
>
{
typedef
A2
Argument2
;
typedef
A2
Argument2
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
,
A2
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
);
typedef
void
MakeResultVoid
(
A1
,
A2
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
);
...
@@ -186,7 +186,7 @@ template <typename R, typename A1, typename A2, typename A3>
...
@@ -186,7 +186,7 @@ template <typename R, typename A1, typename A2, typename A3>
struct
Function
<
R
(
A1
,
A2
,
A3
)
>
struct
Function
<
R
(
A1
,
A2
,
A3
)
>
:
Function
<
R
(
A1
,
A2
)
>
{
:
Function
<
R
(
A1
,
A2
)
>
{
typedef
A3
Argument3
;
typedef
A3
Argument3
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
,
A2
,
A3
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
);
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
);
...
@@ -196,7 +196,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4>
...
@@ -196,7 +196,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4>
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
)
>
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
)
>
:
Function
<
R
(
A1
,
A2
,
A3
)
>
{
:
Function
<
R
(
A1
,
A2
,
A3
)
>
{
typedef
A4
Argument4
;
typedef
A4
Argument4
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
);
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
);
...
@@ -207,7 +207,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
...
@@ -207,7 +207,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
)
>
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
)
>
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
)
>
{
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
)
>
{
typedef
A5
Argument5
;
typedef
A5
Argument5
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
);
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
);
...
@@ -218,7 +218,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
...
@@ -218,7 +218,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
)
>
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
)
>
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
)
>
{
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
)
>
{
typedef
A6
Argument6
;
typedef
A6
Argument6
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
);
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
);
...
@@ -229,7 +229,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
...
@@ -229,7 +229,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
)
>
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
)
>
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
)
>
{
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
)
>
{
typedef
A7
Argument7
;
typedef
A7
Argument7
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
);
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
);
...
@@ -240,7 +240,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
...
@@ -240,7 +240,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
)
>
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
)
>
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
)
>
{
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
)
>
{
typedef
A8
Argument8
;
typedef
A8
Argument8
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
);
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
);
...
@@ -251,7 +251,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
...
@@ -251,7 +251,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
)
>
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
)
>
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
)
>
{
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
)
>
{
typedef
A9
Argument9
;
typedef
A9
Argument9
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
);
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
typedef
IgnoredValue
MakeResultIgnoredValue
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
...
@@ -264,7 +264,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
...
@@ -264,7 +264,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
,
A10
)
>
struct
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
,
A10
)
>
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
)
>
{
:
Function
<
R
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
)
>
{
typedef
A10
Argument10
;
typedef
A10
Argument10
;
typedef
::
std
::
tr1
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
,
typedef
::
testing
::
tuple
<
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
,
A10
>
ArgumentTuple
;
A10
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
,
A10
);
typedef
void
MakeResultVoid
(
A1
,
A2
,
A3
,
A4
,
A5
,
A6
,
A7
,
A8
,
A9
,
A10
);
...
...
include/gmock/internal/gmock-generated-internal-utils.h.pump
View file @
bd018832
...
@@ -77,8 +77,8 @@ $var typename_As = [[$for j, [[typename A$j]]]]
...
@@ -77,8 +77,8 @@ $var typename_As = [[$for j, [[typename A$j]]]]
$
var
As
=
[[
$
for
j
,
[[
A
$
j
]]]]
$
var
As
=
[[
$
for
j
,
[[
A
$
j
]]]]
$
var
matcher_As
=
[[
$
for
j
,
[[
Matcher
<
A
$
j
>
]]]]
$
var
matcher_As
=
[[
$
for
j
,
[[
Matcher
<
A
$
j
>
]]]]
template
<
$
typename_As
>
template
<
$
typename_As
>
struct
MatcherTuple
<
::
std
::
tr1
::
tuple
<
$
As
>
>
{
struct
MatcherTuple
<
::
testing
::
tuple
<
$
As
>
>
{
typedef
::
std
::
tr1
::
tuple
<
$
matcher_As
>
type
;
typedef
::
testing
::
tuple
<
$
matcher_As
>
type
;
};
};
...
@@ -102,7 +102,7 @@ struct Function;
...
@@ -102,7 +102,7 @@ struct Function;
template
<
typename
R
>
template
<
typename
R
>
struct
Function
<
R
()
>
{
struct
Function
<
R
()
>
{
typedef
R
Result
;
typedef
R
Result
;
typedef
::
std
::
tr1
::
tuple
<>
ArgumentTuple
;
typedef
::
testing
::
tuple
<>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
();
typedef
void
MakeResultVoid
();
typedef
IgnoredValue
MakeResultIgnoredValue
();
typedef
IgnoredValue
MakeResultIgnoredValue
();
...
@@ -121,7 +121,7 @@ template <typename R$typename_As>
...
@@ -121,7 +121,7 @@ template <typename R$typename_As>
struct
Function
<
R
(
$
As
)
>
struct
Function
<
R
(
$
As
)
>
:
Function
<
R
(
$
prev_As
)
>
{
:
Function
<
R
(
$
prev_As
)
>
{
typedef
A
$
i
Argument
$
i
;
typedef
A
$
i
Argument
$
i
;
typedef
::
std
::
tr1
::
tuple
<
$
As
>
ArgumentTuple
;
typedef
::
testing
::
tuple
<
$
As
>
ArgumentTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
typename
MatcherTuple
<
ArgumentTuple
>::
type
ArgumentMatcherTuple
;
typedef
void
MakeResultVoid
(
$
As
);
typedef
void
MakeResultVoid
(
$
As
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
$
As
);
typedef
IgnoredValue
MakeResultIgnoredValue
(
$
As
);
...
...
include/gmock/internal/gmock-internal-utils.h
View file @
bd018832
...
@@ -464,7 +464,7 @@ class StlContainerView<Element[N]> {
...
@@ -464,7 +464,7 @@ class StlContainerView<Element[N]> {
// This specialization is used when RawContainer is a native array
// This specialization is used when RawContainer is a native array
// represented as a (pointer, size) tuple.
// represented as a (pointer, size) tuple.
template
<
typename
ElementPointer
,
typename
Size
>
template
<
typename
ElementPointer
,
typename
Size
>
class
StlContainerView
<
::
std
::
tr1
::
tuple
<
ElementPointer
,
Size
>
>
{
class
StlContainerView
<
::
testing
::
tuple
<
ElementPointer
,
Size
>
>
{
public:
public:
typedef
GTEST_REMOVE_CONST_
(
typedef
GTEST_REMOVE_CONST_
(
typename
internal
::
PointeeOf
<
ElementPointer
>::
type
)
RawElement
;
typename
internal
::
PointeeOf
<
ElementPointer
>::
type
)
RawElement
;
...
@@ -472,12 +472,10 @@ class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
...
@@ -472,12 +472,10 @@ class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
typedef
const
type
const_reference
;
typedef
const
type
const_reference
;
static
const_reference
ConstReference
(
static
const_reference
ConstReference
(
const
::
std
::
tr1
::
tuple
<
ElementPointer
,
Size
>&
array
)
{
const
::
testing
::
tuple
<
ElementPointer
,
Size
>&
array
)
{
using
::
std
::
tr1
::
get
;
return
type
(
get
<
0
>
(
array
),
get
<
1
>
(
array
),
kReference
);
return
type
(
get
<
0
>
(
array
),
get
<
1
>
(
array
),
kReference
);
}
}
static
type
Copy
(
const
::
std
::
tr1
::
tuple
<
ElementPointer
,
Size
>&
array
)
{
static
type
Copy
(
const
::
testing
::
tuple
<
ElementPointer
,
Size
>&
array
)
{
using
::
std
::
tr1
::
get
;
return
type
(
get
<
0
>
(
array
),
get
<
1
>
(
array
),
kCopy
);
return
type
(
get
<
0
>
(
array
),
get
<
1
>
(
array
),
kCopy
);
}
}
};
};
...
...
test/gmock-actions_test.cc
View file @
bd018832
...
@@ -45,10 +45,10 @@
...
@@ -45,10 +45,10 @@
namespace
{
namespace
{
using
::
std
::
tr1
::
get
;
using
testing
::
get
;
using
::
std
::
tr1
::
make_tuple
;
using
testing
::
make_tuple
;
using
::
std
::
tr1
::
tuple
;
using
testing
::
tuple
;
using
::
std
::
tr1
::
tuple_element
;
using
testing
::
tuple_element
;
using
testing
::
internal
::
BuiltInDefaultValue
;
using
testing
::
internal
::
BuiltInDefaultValue
;
using
testing
::
internal
::
Int64
;
using
testing
::
internal
::
Int64
;
using
testing
::
internal
::
UInt64
;
using
testing
::
internal
::
UInt64
;
...
...
test/gmock-generated-actions_test.cc
View file @
bd018832
...
@@ -46,10 +46,10 @@ namespace gmock_generated_actions_test {
...
@@ -46,10 +46,10 @@ namespace gmock_generated_actions_test {
using
::
std
::
plus
;
using
::
std
::
plus
;
using
::
std
::
string
;
using
::
std
::
string
;
using
::
std
::
tr1
::
get
;
using
testing
::
get
;
using
::
std
::
tr1
::
make_tuple
;
using
testing
::
make_tuple
;
using
::
std
::
tr1
::
tuple
;
using
testing
::
tuple
;
using
::
std
::
tr1
::
tuple_element
;
using
testing
::
tuple_element
;
using
testing
::
_
;
using
testing
::
_
;
using
testing
::
Action
;
using
testing
::
Action
;
using
testing
::
ActionInterface
;
using
testing
::
ActionInterface
;
...
@@ -639,7 +639,7 @@ TEST(ActionMacroTest, CanReferenceArgumentType) {
...
@@ -639,7 +639,7 @@ TEST(ActionMacroTest, CanReferenceArgumentType) {
// Tests that the body of ACTION() can reference the argument tuple
// Tests that the body of ACTION() can reference the argument tuple
// via args_type and args.
// via args_type and args.
ACTION
(
Sum2
)
{
ACTION
(
Sum2
)
{
StaticAssertTypeEq
<
::
std
::
tr1
::
tuple
<
int
,
char
,
int
*>
,
args_type
>
();
StaticAssertTypeEq
<
tuple
<
int
,
char
,
int
*>
,
args_type
>
();
args_type
args_copy
=
args
;
args_type
args_copy
=
args
;
return
get
<
0
>
(
args_copy
)
+
get
<
1
>
(
args_copy
);
return
get
<
0
>
(
args_copy
)
+
get
<
1
>
(
args_copy
);
}
}
...
@@ -1098,7 +1098,7 @@ TEST(ActionTemplateTest, WorksWithValueParams) {
...
@@ -1098,7 +1098,7 @@ TEST(ActionTemplateTest, WorksWithValueParams) {
ACTION_TEMPLATE
(
MyDeleteArg
,
ACTION_TEMPLATE
(
MyDeleteArg
,
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
HAS_1_TEMPLATE_PARAMS
(
int
,
k
),
AND_0_VALUE_PARAMS
())
{
AND_0_VALUE_PARAMS
())
{
delete
std
::
tr1
::
get
<
k
>
(
args
);
delete
get
<
k
>
(
args
);
}
}
// Resets a bool variable in the destructor.
// Resets a bool variable in the destructor.
...
...
test/gmock-generated-internal-utils_test.cc
View file @
bd018832
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
namespace
{
namespace
{
using
::
std
::
tr1
::
tuple
;
using
::
testing
::
tuple
;
using
::
testing
::
Matcher
;
using
::
testing
::
Matcher
;
using
::
testing
::
internal
::
CompileAssertTypesEqual
;
using
::
testing
::
internal
::
CompileAssertTypesEqual
;
using
::
testing
::
internal
::
MatcherTuple
;
using
::
testing
::
internal
::
MatcherTuple
;
...
...
test/gmock-generated-matchers_test.cc
View file @
bd018832
...
@@ -53,9 +53,9 @@ using std::pair;
...
@@ -53,9 +53,9 @@ using std::pair;
using
std
::
set
;
using
std
::
set
;
using
std
::
stringstream
;
using
std
::
stringstream
;
using
std
::
vector
;
using
std
::
vector
;
using
std
::
tr1
::
get
;
using
testing
::
get
;
using
std
::
tr1
::
make_tuple
;
using
testing
::
make_tuple
;
using
std
::
tr1
::
tuple
;
using
testing
::
tuple
;
using
testing
::
_
;
using
testing
::
_
;
using
testing
::
Args
;
using
testing
::
Args
;
using
testing
::
Contains
;
using
testing
::
Contains
;
...
@@ -507,7 +507,7 @@ class NativeArrayPassedAsPointerAndSize {
...
@@ -507,7 +507,7 @@ class NativeArrayPassedAsPointerAndSize {
TEST
(
ElementsAreTest
,
WorksWithNativeArrayPassedAsPointerAndSize
)
{
TEST
(
ElementsAreTest
,
WorksWithNativeArrayPassedAsPointerAndSize
)
{
int
array
[]
=
{
0
,
1
};
int
array
[]
=
{
0
,
1
};
::
std
::
tr1
::
tuple
<
int
*
,
size_t
>
array_as_tuple
(
array
,
2
);
::
testing
::
tuple
<
int
*
,
size_t
>
array_as_tuple
(
array
,
2
);
EXPECT_THAT
(
array_as_tuple
,
ElementsAre
(
0
,
1
));
EXPECT_THAT
(
array_as_tuple
,
ElementsAre
(
0
,
1
));
EXPECT_THAT
(
array_as_tuple
,
Not
(
ElementsAre
(
0
)));
EXPECT_THAT
(
array_as_tuple
,
Not
(
ElementsAre
(
0
)));
...
@@ -561,7 +561,7 @@ TEST(ElementsAreTest, MakesCopyOfArguments) {
...
@@ -561,7 +561,7 @@ TEST(ElementsAreTest, MakesCopyOfArguments) {
int
x
=
1
;
int
x
=
1
;
int
y
=
2
;
int
y
=
2
;
// This should make a copy of x and y.
// This should make a copy of x and y.
::
testing
::
internal
::
ElementsAreMatcher
<
std
::
tr1
::
tuple
<
int
,
int
>
>
::
testing
::
internal
::
ElementsAreMatcher
<
testing
::
tuple
<
int
,
int
>
>
polymorphic_matcher
=
ElementsAre
(
x
,
y
);
polymorphic_matcher
=
ElementsAre
(
x
,
y
);
// Changing x and y now shouldn't affect the meaning of the above matcher.
// Changing x and y now shouldn't affect the meaning of the above matcher.
x
=
y
=
0
;
x
=
y
=
0
;
...
...
test/gmock-internal-utils_test.cc
View file @
bd018832
...
@@ -59,9 +59,6 @@ namespace internal {
...
@@ -59,9 +59,6 @@ namespace internal {
namespace
{
namespace
{
using
::
std
::
tr1
::
make_tuple
;
using
::
std
::
tr1
::
tuple
;
TEST
(
ConvertIdentifierNameToWordsTest
,
WorksWhenNameContainsNoWord
)
{
TEST
(
ConvertIdentifierNameToWordsTest
,
WorksWhenNameContainsNoWord
)
{
EXPECT_EQ
(
""
,
ConvertIdentifierNameToWords
(
""
));
EXPECT_EQ
(
""
,
ConvertIdentifierNameToWords
(
""
));
EXPECT_EQ
(
""
,
ConvertIdentifierNameToWords
(
"_"
));
EXPECT_EQ
(
""
,
ConvertIdentifierNameToWords
(
"_"
));
...
...
test/gmock-matchers_test.cc
View file @
bd018832
...
@@ -81,9 +81,9 @@ using std::ostream;
...
@@ -81,9 +81,9 @@ using std::ostream;
using
std
::
pair
;
using
std
::
pair
;
using
std
::
set
;
using
std
::
set
;
using
std
::
stringstream
;
using
std
::
stringstream
;
using
std
::
tr1
::
get
;
using
testing
::
get
;
using
std
::
tr1
::
make_tuple
;
using
testing
::
make_tuple
;
using
std
::
tr1
::
tuple
;
using
testing
::
tuple
;
using
std
::
vector
;
using
std
::
vector
;
using
testing
::
A
;
using
testing
::
A
;
using
testing
::
AllArgs
;
using
testing
::
AllArgs
;
...
@@ -1896,7 +1896,7 @@ TEST(GlobalWideEndsWithTest, CanDescribeSelf) {
...
@@ -1896,7 +1896,7 @@ TEST(GlobalWideEndsWithTest, CanDescribeSelf) {
#endif // GTEST_HAS_GLOBAL_WSTRING
#endif // GTEST_HAS_GLOBAL_WSTRING
typedef
::
std
::
tr1
::
tuple
<
long
,
int
>
Tuple2
;
// NOLINT
typedef
::
testing
::
tuple
<
long
,
int
>
Tuple2
;
// NOLINT
// Tests that Eq() matches a 2-tuple where the first field == the
// Tests that Eq() matches a 2-tuple where the first field == the
// second field.
// second field.
...
...
test/gmock-more-actions_test.cc
View file @
bd018832
...
@@ -47,10 +47,10 @@ namespace gmock_more_actions_test {
...
@@ -47,10 +47,10 @@ namespace gmock_more_actions_test {
using
::
std
::
plus
;
using
::
std
::
plus
;
using
::
std
::
string
;
using
::
std
::
string
;
using
::
std
::
tr1
::
get
;
using
testing
::
get
;
using
::
std
::
tr1
::
make_tuple
;
using
testing
::
make_tuple
;
using
::
std
::
tr1
::
tuple
;
using
testing
::
tuple
;
using
::
std
::
tr1
::
tuple_element
;
using
testing
::
tuple_element
;
using
testing
::
_
;
using
testing
::
_
;
using
testing
::
Action
;
using
testing
::
Action
;
using
testing
::
ActionInterface
;
using
testing
::
ActionInterface
;
...
...
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