Skip to content

Commit 9828843

Browse files
committed
Fix #43
1 parent 9a6a36e commit 9828843

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CppHeaderParser/CppHeaderParser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,7 @@ def finalize(self):
19571957
"static": 0,
19581958
"pointer": 0,
19591959
"reference": 0,
1960+
"typedefs": 0,
19601961
}
19611962
self.resolve_type(meth["rtnType"], rtnType)
19621963
if not rtnType["unresolved"]:

test/test_CppHeaderParser.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3868,5 +3868,30 @@ def test_fn(self):
38683868
self.assertEqual(c["type"], "C")
38693869

38703870

3871+
class MoreTypedef(unittest.TestCase):
3872+
def setUp(self):
3873+
self.cppHeader = CppHeaderParser.CppHeader(
3874+
"""
3875+
typedef C A;
3876+
3877+
class B {
3878+
public:
3879+
A aMethod();
3880+
};
3881+
""",
3882+
"string",
3883+
)
3884+
3885+
def test_fn(self):
3886+
c = self.cppHeader.classes["B"]
3887+
self.assertEqual("B", c["name"])
3888+
3889+
m = c["methods"]["public"][0]
3890+
self.assertEqual(m["name"], "aMethod")
3891+
self.assertEqual(m["rtnType"], "A")
3892+
3893+
self.assertEqual(self.cppHeader.typedefs["A"], "C")
3894+
3895+
38713896
if __name__ == "__main__":
38723897
unittest.main()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy