Skip to content

Commit

Permalink
Add enum literals for paramaterized messages validation tests
Browse files Browse the repository at this point in the history
Ref. #865
  • Loading branch information
Alexander Senier authored and senier committed Dec 7, 2021
1 parent 3d5bee1 commit f0b427f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/data/specs/parameterized.rflx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package Parameterized is

type Length is range 0 .. 2 ** 16 - 1 with Size => 16;
type Tag is (Tag_A, Tag_B) with Size => 8;
type Tag_Mode is (With_Tag, Without_Tag) with Size => 8;

type Message (Length : Length; Has_Tag : Boolean; Tag_Value : Tag) is
type Message (Length : Length; Tag_Mode : Tag_Mode; Tag_Value : Tag) is
message
Payload : Opaque
with Size => Length * 8
then Tag
if Has_Tag = True
if Tag_Mode = With_Tag
then null
if Has_Tag = False;
if Tag_Mode = Without_Tag;
Tag : Tag
then null
if Tag = Tag_Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Length: 2
Has_Tag: True
Tag_Mode: With_Tag
Tag_Value: Tag_A
Excess: 42
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Length: 2
Tag_Value: Tag_A
Tag_Mode: Without_Tag
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Length: 2
Has_Tag: True
Tag_Mode: With_Tag
Tag_Value: Tag_A

0 comments on commit f0b427f

Please sign in to comment.