From 8591e3114f22edec1eaebef4086bed06fc8386ba Mon Sep 17 00:00:00 2001 From: Spicuzza Date: Sun, 21 Nov 2021 12:56:26 -0500 Subject: [PATCH 1/4] Add test for mutable - Fixes #19 --- tests/test_class.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/test_class.py b/tests/test_class.py index f71f6e1..183374c 100644 --- a/tests/test_class.py +++ b/tests/test_class.py @@ -2958,3 +2958,42 @@ def test_class_volatile(): ] ) ) + +def test_class_mutable(): + content = """ + class Foo + { + private: + + mutable volatile Standard_Integer myRefCount_; + + }; + """ + data = parse_string(content, cleandoc=True) + + assert data == ParsedData( + namespace=NamespaceScope( + classes=[ + ClassScope( + class_decl=ClassDecl( + typename=PQName( + segments=[NameSpecifier(name="Foo")], classkey="class" + ) + ), + fields=[ + Field( + access="private", + type=Type( + typename=PQName( + segments=[NameSpecifier(name="Standard_Integer")] + ), + volatile=True, + ), + name="myRefCount_", + mutable=True, + ) + ], + ) + ] + ) + ) \ No newline at end of file From 420f293eaddffde8c91078613633b932c182b844 Mon Sep 17 00:00:00 2001 From: Spicuzza Date: Sun, 21 Nov 2021 12:59:54 -0500 Subject: [PATCH 2/4] Add test for inline + volatile function - Fixes #18 --- tests/test_fn.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/test_fn.py b/tests/test_fn.py index 9b571be..ef91532 100644 --- a/tests/test_fn.py +++ b/tests/test_fn.py @@ -821,3 +821,38 @@ def test_fn_trailing_return_std_function(): ] ) ) + +def test_inline_volatile_fn(): + content = """ + inline int Standard_Atomic_Increment (volatile int* theValue); + """ + data = parse_string(content, cleandoc=True) + + assert data == ParsedData( + namespace=NamespaceScope( + functions=[ + Function( + return_type=Type( + typename=PQName(segments=[FundamentalSpecifier(name="int")]) + ), + name=PQName( + segments=[NameSpecifier(name="Standard_Atomic_Increment")] + ), + parameters=[ + Parameter( + type=Pointer( + ptr_to=Type( + typename=PQName( + segments=[FundamentalSpecifier(name="int")] + ), + volatile=True, + ) + ), + name="theValue", + ) + ], + inline=True, + ) + ] + ) + ) \ No newline at end of file From 5f57509568ec08e334db1885dcef448002d15b76 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Thu, 25 Nov 2021 22:51:08 -0500 Subject: [PATCH 3/4] Format with latest black --- tests/test_class.py | 3 ++- tests/test_fn.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_class.py b/tests/test_class.py index 183374c..a932589 100644 --- a/tests/test_class.py +++ b/tests/test_class.py @@ -2959,6 +2959,7 @@ def test_class_volatile(): ) ) + def test_class_mutable(): content = """ class Foo @@ -2996,4 +2997,4 @@ def test_class_mutable(): ) ] ) - ) \ No newline at end of file + ) diff --git a/tests/test_fn.py b/tests/test_fn.py index ef91532..c8d974a 100644 --- a/tests/test_fn.py +++ b/tests/test_fn.py @@ -822,6 +822,7 @@ def test_fn_trailing_return_std_function(): ) ) + def test_inline_volatile_fn(): content = """ inline int Standard_Atomic_Increment (volatile int* theValue); @@ -855,4 +856,4 @@ def test_inline_volatile_fn(): ) ] ) - ) \ No newline at end of file + ) From 7094a0c6779e2387b3d4ca428695b57513a12f61 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Thu, 25 Nov 2021 23:37:14 -0500 Subject: [PATCH 4/4] Add python 3.10 to github actions --- .github/workflows/dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index cb12809..68bdd86 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -39,7 +39,7 @@ jobs: strategy: matrix: os: [windows-latest, macos-latest, ubuntu-18.04] - python_version: [3.6, 3.7, 3.8, 3.9] + python_version: [3.6, 3.7, 3.8, 3.9, "3.10"] architecture: [x86, x64] exclude: - os: macos-latest