Skip to content

Commit

Permalink
Test session function with local return type
Browse files Browse the repository at this point in the history
Ref. #892
  • Loading branch information
Alexander Senier committed Jan 6, 2022
1 parent 2af9c76 commit 9f89974
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/integration/session_functions/test.rflx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ with Universal;

package Test is

type Result is (M_Valid, M_Invalid) with Size => 2;

generic
Channel : Channel with Readable, Writable; -- §S-P-C-RW
-- §S-P-F-R-S
Expand All @@ -16,7 +18,7 @@ package Test is
with function Valid_Message
(Message_Type : Universal::Option_Type;
Strict : Boolean)
return Boolean;
return Result;
session Session with
Initial => Start,
Final => Terminated
Expand All @@ -36,15 +38,15 @@ package Test is
end Start;

state Process is
Valid : Boolean; -- §S-S-D-V-T-SC
Valid : Result; -- §S-S-D-V-T-SC
Message_Type : Universal::Option_Type; -- §S-S-D-V-T-SC, §S-S-D-V-E-N
begin
Message_Type := Get_Message_Type; -- §S-S-A-A-CL, §S-E-CL-N
Valid := Valid_Message (Message_Type, True); -- §S-S-A-A-CL, §S-E-CL-L
Fixed_Size_Message := Create_Message (Message_Type, Message.Data); -- §S-S-A-A-CL, §S-E-CL-V, §S-E-CL-S
transition
goto Terminated
if Valid = False -- §S-S-T-BE
if Valid = M_Valid -- §S-S-T-BE
goto Reply -- §S-S-T-N
exception
goto Terminated -- §S-S-E
Expand Down

0 comments on commit 9f89974

Please sign in to comment.