Merge pull request #25 from robotpy/fixes
Add tests for bugs that were already fixed
This commit is contained in:
commit
b1808f77ad
2
.github/workflows/dist.yml
vendored
2
.github/workflows/dist.yml
vendored
@ -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
|
||||
|
@ -2958,3 +2958,43 @@ 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,
|
||||
)
|
||||
],
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
||||
|
@ -821,3 +821,39 @@ 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,
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user