Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
d927e48a
Commit
d927e48a
authored
Apr 14, 2021
by
Maxime Perrotin
Browse files
Update test case with an alias
parent
87c7891c
Changes
5
Show whitespace changes
Inline
Side-by-side
test/iterators/work/simulation/mcsrc/mc.adb
View file @
d927e48a
...
...
@@ -42,8 +42,6 @@ procedure MC is
-- end Encode_And_md5;
begin
-- Set once for all a pointer to the current state in the observers
My_Observer
.
St
:=
Simulator_Pkg
.
User_State
'
Unchecked_Access
;
Simulator_Pkg
.
Simulation_Startup
;
-- Encode_And_md5 (Simulator.State);
...
...
test/iterators/work/simulation/mcsrc/properties.adb
View file @
d927e48a
...
...
@@ -30,27 +30,27 @@ package body Properties is
end
Print_Full_State
;
procedure
My_Properties
(
Full_State
:
in
out
State_With_Observers
;
Event
:
access
asn1sccObservable_Event
;
Event
:
in
out
asn1sccObservable_Event
;
Id
:
out
Natural
;
Success
:
out
Boolean
)
is
Local_Event
:
aliased
asn1sccObservable_Event
:=
Event
.
all
;
begin
Id
:=
0
;
-- Restore the state of the observer, and execute it
My_Observer
.
Ctxt
:=
Full_State
.
My_Observer_State
;
-- Put_Line ("[OBS] Context set to: " & GSER.Image (My_Observer.Ctxt));
-- Set the
event in the
observer's monitor
My_Observer
.
Event
:=
Local_Event
'
Unchecked_access
;
-- Set the observer's monitor
s
My_Observer
.
Event
:=
Event
;
My_Observer
.
St
:=
Full_State
.
User_State
;
My_Observer
.
Observe
;
-- Read the modified state from the observer
Event
:=
My_Observer
.
Event
;
Full_State
.
User_state
:=
My_Observer
.
St
;
Full_State
.
My_Observer_State
:=
My_Observer
.
Ctxt
;
-- Simple stop condition:
Success
:=
(
My_Observer
.
Ctxt
.
State
=
My_Observer_Datamodel
.
asn1SccEnd_Success
);
if
Success
then
Put_Line
(
"Stop condition found"
);
end
if
;
end
;
end
Properties
;
test/iterators/work/simulation/mcsrc/properties.ads
View file @
d927e48a
...
...
@@ -41,7 +41,7 @@ package Properties is
pragma
Export
(
C
,
Check_Queue
,
"my_observer_check_queue"
);
procedure
My_Properties
(
Full_State
:
in
out
State_With_Observers
;
Event
:
access
asn1sccObservable_Event
;
Event
:
in
out
asn1sccObservable_Event
;
Id
:
out
Natural
;
Success
:
out
Boolean
);
...
...
test/iterators/work/simulation/observer/observer.asn
View file @
d927e48a
...
...
@@ -114,7 +114,7 @@ IMPORTS
T-Null, T-Int, T-SeqOf FROM Iterators-Types
T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean, T-Null-Record FROM TASTE-BasicTypes;
Orchestrator-States ::= ENUMERATED {
wait,
step-2}
Orchestrator-States ::= ENUMERATED {step-2
, wait
}
Orchestrator-Context ::= SEQUENCE {
state Orchestrator-States,
...
...
test/iterators/work/simulation/observer/observer.pr
View file @
d927e48a
...
...
@@ -18,12 +18,14 @@ observe;
connect c and r;
/* CIF PROCESS (250, 87), (150, 75) */
process my_observer;
/* CIF TEXT (0, 57), (
223, 88
) */
/* CIF TEXT (0, 57), (
309, 104
) */
monitor st System_State;
monitor event Observable_Event;
dcl count T_Int renames st.orchestrator.counter;
/* CIF ENDTEXT */
/* CIF procedure (126
2
, 63), (70, 35) */
/* CIF procedure (12
5
6, 63), (70, 35) */
procedure observe;
/* CIF TEXT (38, 48), (313, 72) */
-- this procedure could be generated automatically,
...
...
@@ -34,13 +36,13 @@ observe;
/* CIF return (198, 208), (35, 35) */
return ;
endprocedure;
/* CIF START (
349
, 78), (70, 35) */
/* CIF START (
433
, 78), (70, 35) */
START;
/* CIF PROCEDURECALL (3
04
, 133), (159, 35) */
/* CIF PROCEDURECALL (3
88
, 133), (159, 35) */
call writeln ('observer init');
/* CIF NEXTSTATE (
3
42, 183), (83, 35) */
/* CIF NEXTSTATE (42
6
, 183), (83, 35) */
NEXTSTATE first_state;
/* CIF state (10
2
1, 111), (101, 35) */
/* CIF state (101
5
, 111), (101, 35) */
state second_state;
/* CIF provided (963, 168), (241, 35) */
provided st.orchestrator.magic_number = 42;
...
...
@@ -49,10 +51,10 @@ observe;
/* CIF NEXTSTATE (1033, 273), (101, 35) */
NEXTSTATE third_state;
endstate;
/* CIF state (1
24
, 218), (95, 35) */
/* CIF state (1
18
, 218), (95, 35) */
state end_success;
endstate;
/* CIF state (11
45
, 316), (88, 35) */
/* CIF state (11
39
, 316), (88, 35) */
state third_state;
/* CIF provided (1104, 371), (341, 136) */
provided event =
...
...
@@ -66,29 +68,29 @@ priority 2;
call writeln ('SUCCESS(1)');
/* CIF NEXTSTATE (1226, 593), (95, 35) */
NEXTSTATE end_success;
/* CIF provided (5
34
, 371), (525, 104) */
/* CIF provided (5
28
, 371), (525, 104) */
provided present(event) = output_event
and then event.output_event.dest = simulator_gui
and then present(event.output_event.event) = orchestrator
and then present(event.output_event.event.orchestrator.msg_out) = paramesstogui;
priority 3;
/* CIF PROCEDURECALL (70
9
, 506), (176, 35) */
/* CIF PROCEDURECALL (70
3
, 506), (176, 35) */
call writeln ('SUCCESS(2)');
/* CIF NEXTSTATE (74
9
, 561), (95, 35) */
/* CIF NEXTSTATE (74
3
, 561), (95, 35) */
NEXTSTATE end_success;
/* CIF provided (14
5
4, 371), (268, 40) */
/* CIF provided (144
8
, 371), (268, 40) */
provided output paramesstogui from orchestrator;
priority 1;
/* CIF NEXTSTATE (15
40
, 431), (95, 40) */
/* CIF NEXTSTATE (15
35
, 431), (95, 40) */
NEXTSTATE end_success;
endstate;
/* CIF state (
3
42, 183), (83, 35) */
/* CIF state (42
6
, 183), (83, 35) */
state first_state;
/* CIF provided (
280
, 239), (208, 35) */
/* CIF provided (
364
, 239), (208, 35) */
provided st.orchestrator.counter = 3;
/* CIF PROCEDURECALL (
233
, 294), (300, 35) */
/* CIF PROCEDURECALL (
317
, 294), (300, 35) */
call writeln ('[observer] step 1 passed (counter=3)');
/* CIF NEXTSTATE (
333
, 349), (101, 35) */
/* CIF NEXTSTATE (
417
, 349), (101, 35) */
NEXTSTATE second_state;
endstate;
endprocess my_observer;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment