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
b88511ef
Unverified
Commit
b88511ef
authored
Aug 21, 2018
by
Gennadiy Civil
Committed by
GitHub
Aug 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1194 from joshbodily/josh/fix_scoped_class2
Fix scoped enum not working in gmock-gen.py
parents
735bd75f
a6e7ba27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
ast.py
googlemock/scripts/generator/cpp/ast.py
+3
-0
gmock_class_test.py
googlemock/scripts/generator/cpp/gmock_class_test.py
+18
-0
No files found.
googlemock/scripts/generator/cpp/ast.py
View file @
b88511ef
...
...
@@ -1264,6 +1264,9 @@ class AstBuilder(object):
return
self
.
_GetNestedType
(
Union
)
def
handle_enum
(
self
):
token
=
self
.
_GetNextToken
()
if
not
(
token
.
token_type
==
tokenize
.
NAME
and
token
.
name
==
'class'
):
self
.
_AddBackToken
(
token
)
return
self
.
_GetNestedType
(
Enum
)
def
handle_auto
(
self
):
...
...
googlemock/scripts/generator/cpp/gmock_class_test.py
View file @
b88511ef
...
...
@@ -444,5 +444,23 @@ void(const FooType& test_arg));
self
.
assertEqualIgnoreLeadingWhitespace
(
expected
,
self
.
GenerateMocks
(
source
))
def
testEnumClass
(
self
):
source
=
"""
class Test {
public:
enum class Baz { BAZINGA };
virtual void Bar(const FooType& test_arg);
};
"""
expected
=
"""
\
class MockTest : public Test {
public:
MOCK_METHOD1(Bar,
void(const FooType& test_arg));
};
"""
self
.
assertEqualIgnoreLeadingWhitespace
(
expected
,
self
.
GenerateMocks
(
source
))
if
__name__
==
'__main__'
:
unittest
.
main
()
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