Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more tests for mspec parser and code generator. #1738

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
[simple string 8 abstractStringField]
]
]
//[abstract bit oneMoreBit] // TODO: apparently this breaks java
[abstract bit oneMoreBit] // TODO: apparently this breaks java
]

[type ArrayTypeTest
Expand Down Expand Up @@ -213,6 +213,23 @@
]
]

// Check field with arguments
[type Struct(bit signed, bit unsigned)
[typeSwitch signed
['true' SignedType
[simple int 8 data]
]
['false' UnsignedType
[simple uint 8 data]
]
]
]

[type StructContainer
[simple bit signed]
[simple Struct('signed', '!signed') struct]
]

// TODO: So far only trouble in GO, C seems OK.
[type VirtualFieldTest
[simple uint 8 simpleField]
Expand Down Expand Up @@ -476,7 +493,6 @@
// TypeSwitch in TypeSwitch
////////////////////////////////////////////////////////////////

/* Needs to be ported to C and GO
[discriminatedType TTGranddad
[discriminator uint 8 dadNumber]
[simple uint 8 warStories]
Expand All @@ -499,6 +515,7 @@
]
]

/* Needs to be ported to C and GO
[discriminatedType TypeSwitchInTypeSwitchParentType
[discriminator uint 8 typeNumber]
[simple uint 8 parentFieldHurz]
Expand Down Expand Up @@ -560,6 +577,19 @@
]
]*/

[discriminatedType TypeSwitchWithArg(bit arg1, uint 8 arg2)
[abstract bit isItTrue]
[simple uint 8 value]
[typeSwitch arg1
['true' TrustfulTypeSwitch(uint 8 value)
[virtual bit isItTrue 'true']
]
['false' UnTrustfulTypeSwitch(uint 8 value)
[virtual bit isItTrue 'false']
]
]
]

////////////////////////////////////////////////////////////////
// Missing Tests
////////////////////////////////////////////////////////////////
Expand Down
Loading