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
713b0778
Commit
713b0778
authored
Aug 10, 2017
by
Josh Bodily
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix scoped enum not working in gmock-gen.py
parent
75f0723c
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 @
713b0778
...
@@ -1264,6 +1264,9 @@ class AstBuilder(object):
...
@@ -1264,6 +1264,9 @@ class AstBuilder(object):
return
self
.
_GetNestedType
(
Union
)
return
self
.
_GetNestedType
(
Union
)
def
handle_enum
(
self
):
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
)
return
self
.
_GetNestedType
(
Enum
)
def
handle_auto
(
self
):
def
handle_auto
(
self
):
...
...
googlemock/scripts/generator/cpp/gmock_class_test.py
View file @
713b0778
...
@@ -444,5 +444,23 @@ void(const FooType& test_arg));
...
@@ -444,5 +444,23 @@ void(const FooType& test_arg));
self
.
assertEqualIgnoreLeadingWhitespace
(
self
.
assertEqualIgnoreLeadingWhitespace
(
expected
,
self
.
GenerateMocks
(
source
))
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__'
:
if
__name__
==
'__main__'
:
unittest
.
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