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
21a5846a
Commit
21a5846a
authored
Nov 12, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes gmock-generated-function-mockers.h conform to the C++ standard.
parent
4910d29e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
20 deletions
+61
-20
gmock-generated-function-mockers.h
include/gmock/gmock-generated-function-mockers.h
+56
-15
gmock-generated-function-mockers.h.pump
include/gmock/gmock-generated-function-mockers.h.pump
+5
-5
No files found.
include/gmock/gmock-generated-function-mockers.h
View file @
21a5846a
...
...
@@ -42,10 +42,6 @@
#include <gmock/internal/gmock-internal-utils.h>
namespace
testing
{
template
<
typename
F
>
class
MockSpec
;
namespace
internal
{
template
<
typename
F
>
...
...
@@ -71,7 +67,11 @@ class FunctionMocker<R()> : public
}
R
Invoke
()
{
return
InvokeWith
(
ArgumentTuple
());
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
());
}
};
...
...
@@ -88,7 +88,11 @@ class FunctionMocker<R(A1)> : public
}
R
Invoke
(
A1
a1
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
));
}
};
...
...
@@ -105,7 +109,11 @@ class FunctionMocker<R(A1, A2)> : public
}
R
Invoke
(
A1
a1
,
A2
a2
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
));
}
};
...
...
@@ -123,7 +131,11 @@ class FunctionMocker<R(A1, A2, A3)> : public
}
R
Invoke
(
A1
a1
,
A2
a2
,
A3
a3
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
));
}
};
...
...
@@ -141,7 +153,11 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public
}
R
Invoke
(
A1
a1
,
A2
a2
,
A3
a3
,
A4
a4
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
));
}
};
...
...
@@ -161,7 +177,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
}
R
Invoke
(
A1
a1
,
A2
a2
,
A3
a3
,
A4
a4
,
A5
a5
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
));
}
};
...
...
@@ -182,7 +202,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
}
R
Invoke
(
A1
a1
,
A2
a2
,
A3
a3
,
A4
a4
,
A5
a5
,
A6
a6
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
));
}
};
...
...
@@ -203,7 +227,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
}
R
Invoke
(
A1
a1
,
A2
a2
,
A3
a3
,
A4
a4
,
A5
a5
,
A6
a6
,
A7
a7
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
));
}
};
...
...
@@ -224,7 +252,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
}
R
Invoke
(
A1
a1
,
A2
a2
,
A3
a3
,
A4
a4
,
A5
a5
,
A6
a6
,
A7
a7
,
A8
a8
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
,
a8
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
,
a8
));
}
};
...
...
@@ -246,7 +278,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
}
R
Invoke
(
A1
a1
,
A2
a2
,
A3
a3
,
A4
a4
,
A5
a5
,
A6
a6
,
A7
a7
,
A8
a8
,
A9
a9
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
,
a8
,
a9
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
,
a8
,
a9
));
}
};
...
...
@@ -270,7 +306,12 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
R
Invoke
(
A1
a1
,
A2
a2
,
A3
a3
,
A4
a4
,
A5
a5
,
A6
a6
,
A7
a7
,
A8
a8
,
A9
a9
,
A10
a10
)
{
return
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
,
a8
,
a9
,
a10
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
,
a8
,
a9
,
a10
));
}
};
...
...
include/gmock/gmock-generated-function-mockers.h.pump
View file @
21a5846a
...
...
@@ -45,10 +45,6 @@ $var n = 10 $$ The maximum arity we support.
#include <gmock/internal/gmock-internal-utils.h>
namespace
testing
{
template
<
typename
F
>
class
MockSpec
;
namespace
internal
{
template
<
typename
F
>
...
...
@@ -89,7 +85,11 @@ $if i >= 1 [[
}
R
Invoke
(
$
Aas
)
{
return
InvokeWith
(
ArgumentTuple
(
$
as
));
// Even though gcc and MSVC don't enforce it, 'this->' is required
// by the C++ standard [14.6.4] here, as the base class type is
// dependent on the template argument (and thus shouldn't be
// looked into when resolving InvokeWith).
return
this
->
InvokeWith
(
ArgumentTuple
(
$
as
));
}
};
...
...
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