Skip to content

Commit

Permalink
Add more tests for mspec parser and code generator.
Browse files Browse the repository at this point in the history
Signed-off-by: Łukasz Dywicki <[email protected]>
  • Loading branch information
splatch committed Aug 23, 2024
1 parent cd13df2 commit 54f4d31
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@
]
]

// Check field with arguments
[type Struct(bit signed, byte data)
]
[type StructContainer
[simple bit signed]
[simple byte data]
[virtual Struct('signed', 'data') struct]
]
// TODO: So far only trouble in GO, C seems OK.
[type VirtualFieldTest
[simple uint 8 simpleField]
Expand Down Expand Up @@ -475,7 +486,7 @@
// TypeSwitch in TypeSwitch
////////////////////////////////////////////////////////////////
/* Needs to be ported to C and GO
/* Needs to be ported to C and GO */
[discriminatedType TypeSwitchInTypeSwitchParentType
[discriminator uint 8 typeNumber]
[simple uint 8 parentFieldHurz]
Expand Down Expand Up @@ -535,7 +546,20 @@
]
]
]
]*/
]
[discriminatedType TypeSwitchWithArg(bit arg1, uint 8 arg2)
[abstract bit isItTrue]
[discriminator uint 8 typeNumber]
[typeSwitch arg1
['true' TrustfulTypeSwitch(bit arg1, uint 8 arg2)
[virtual bit isItTrue 'true']
]
['false' UnTrustfulTypeSwitch(bit arg1, uint 8 arg2)
[virtual bit isItTrue 'false']
]
]
]
////////////////////////////////////////////////////////////////
// Missing Tests
Expand Down

0 comments on commit 54f4d31

Please sign in to comment.