Commit 68131ce0 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Test case for "decision any"

parent 75a6209f
/* CIF PROCESS (295, 56), (150, 75) */
PROCESS orchestrator
/* CIF COMMENT (405, 192), (71, 35) */
COMMENT 'Hello';
/* CIF TEXT (0, 94), (450, 353) */
process orchestrator
/* CIF comment (405, 192), (71, 35) */
comment 'Hello';
/* CIF TEXT (0, 94), (450, 376) */
dcl seq tastE_Peek_id_list := { 1,2,3,4,5};
dcl fixed FixedString := 'Hello';
dcl variable VariableString := 'Hello';
dcl seqboolean SeqBool := { true, false };
dcl seqbool2 SeqBoolFix := { true, false };
dcl seqen SeqEnum := { hello2, world2};
dcl seqen2 SeqEnumFix := { hello, world };
dcl myenum MyEnum := a;
dcl turlututu MyEnum := a;
dcl check tasTE_Peek_id := 42;
dcl choice Mychoice := c1:TRUE ;
dcl opt SeqOpt := { A TRUE, b FALSE }; -- test optional fields
dcl somebool boolean := true;
-- dcl opt2 SeqOpt := { a somebool, b false }; SHOULD REPORT AND ERROR
dcl fixed FixedString := 'Hello';
dcl variable VariableString := 'Hello';
dcl seqboolean SeqBool := { true, false };
dcl seqbool2 SeqBoolFix := { true, false };
dcl seqen SeqEnum := { hello2, world2};
dcl seqen2 SeqEnumFix := { hello, world };
dcl myenum MyEnum := a;
dcl turlututu MyEnum := a;
dcl check tasTE_Peek_id := 42;
dcl choice Mychoice := c1:TRUE ;
dcl opt SeqOpt := { A TRUE, b FALSE }; -- test optional fields
dcl somebool boolean := true;
-- dcl opt2 SeqOpt := { a somebool, b false }; SHOULD REPORT AND ERROR
/* CIF ENDTEXT */
/* CIF PROCEDURE (1306, 371), (91, 35) */
PROCEDURE numProc;
/* CIF procedure (1273, 175), (106, 35) */
procedure emptyproc;
endprocedure;
/* CIF procedure (1306, 371), (91, 35) */
procedure numProc;
/* CIF START (161, 82), (70, 35) */
START;
/* CIF DECISION (135, 132), (122, 50) */
DECISION num(myenum);
/* CIF ANSWER (163, 202), (70, 23) */
else:
ENDDECISION;
/* CIF DECISION (135, 240), (122, 50) */
DECISION num(myenum);
/* CIF ANSWER (163, 310), (70, 23) */
else:
ENDDECISION;
/* CIF RETURN (178, 348), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF PROCEDURE (1273, 175), (106, 35) */
PROCEDURE emptyproc;
ENDPROCEDURE;
/* CIF START (596, 224), (80, 36) */
START;
/* CIF TASK (564, 275), (144, 35) */
TASK opt := { B TRUE }
/* CIF COMMENT (728, 275), (155, 35) */
COMMENT 'Test optional fields';
/* CIF DECISION (575, 325), (122, 50) */
DECISION num(myenum);
/* CIF ANSWER (563, 395), (70, 23) */
(0):
/* CIF ANSWER (635, 395), (70, 23) */
/* CIF decision (161, 137), (70, 50) */
decision any;
/* CIF ANSWER (71, 207), (70, 24) */
('a'):
/* CIF ANSWER (161, 207), (70, 24) */
('b'):
/* CIF ANSWER (251, 207), (70, 24) */
('c'):
enddecision;
/* CIF decision (135, 247), (122, 50) */
decision num(myenum);
/* CIF ANSWER (163, 317), (70, 24) */
else:
ENDDECISION;
/* CIF DECISION (575, 433), (122, 50) */
DECISION num(myenum);
/* CIF ANSWER (564, 503), (70, 23) */
(0):
/* CIF ANSWER (644, 503), (70, 23) */
enddecision;
/* CIF decision (135, 357), (122, 50) */
decision num(myenum);
/* CIF ANSWER (163, 427), (70, 24) */
else:
ENDDECISION;
/* CIF DECISION (586, 541), (99, 50) */
DECISION 'informal'
/* CIF COMMENT (746, 540), (179, 53) */
COMMENT 'Informal decision -
enddecision;
/* CIF return (178, 467), (35, 35) */
return ;
endprocedure;
/* CIF START (596, 224), (80, 36) */
START;
/* CIF task (564, 275), (144, 35) */
task opt := { B TRUE }
/* CIF comment (728, 275), (155, 35) */
comment 'Test optional fields';
/* CIF decision (575, 325), (122, 50) */
decision num(myenum);
/* CIF ANSWER (563, 395), (70, 24) */
(0):
/* CIF ANSWER (635, 395), (70, 24) */
else:
enddecision;
/* CIF decision (575, 435), (122, 50) */
decision num(myenum);
/* CIF ANSWER (564, 505), (70, 24) */
(0):
/* CIF ANSWER (644, 505), (70, 24) */
else:
enddecision;
/* CIF decision (586, 545), (99, 50) */
decision 'informal'
/* CIF comment (746, 542), (179, 56) */
comment 'Informal decision -
check that it is ignored
by the code generator';
/* CIF ANSWER (572, 611), (70, 33) */
('a'):
/* CIF ANSWER (652, 611), (70, 33) */
('2'):
ENDDECISION;
/* CIF TASK (524, 659), (223, 38) */
TASK seqboolean := {true, false},
/* CIF ANSWER (572, 615), (70, 33) */
('a'):
/* CIF ANSWER (652, 615), (70, 33) */
('2'):
enddecision;
/* CIF task (524, 664), (223, 40) */
task seqboolean := {true, false},
seqboolean := not {true, false};
/* CIF TASK (532, 712), (208, 83) */
TASK for x in seqen:
/* CIF task (532, 721), (208, 88) */
task for x in seqen:
call writeln(num(x));
call writeln(num(myenum));
call writeln(num(myenum));
endfor
/* CIF COMMENT (774, 734), (174, 38) */
COMMENT 'Check that num is not
/* CIF comment (774, 742), (174, 40) */
comment 'Check that num is not
declared twice';
/* CIF TASK (554, 810), (164, 53) */
TASK for x in seqen2:
/* CIF task (554, 829), (164, 56) */
task for x in seqen2:
call writeln(num(x));
endfor;
/* CIF TASK (555, 878), (162, 53) */
TASK for x in seqboolean:
/* CIF task (555, 903), (162, 56) */
task for x in seqboolean:
call writeln(x);
endfor
/* CIF COMMENT (747, 885), (168, 38) */
COMMENT 'FOR with a basic type';
/* CIF TASK (525, 946), (222, 35) */
TASK seqboolean := not seqboolean
/* CIF COMMENT (781, 946), (279, 35) */
COMMENT 'check NOT on a SEQUENCE of BOOLEAN';
/* CIF TASK (555, 996), (162, 53) */
TASK for x in seqboolean:
/* CIF comment (747, 908), (168, 38) */
comment 'FOR with a basic type';
/* CIF task (525, 977), (222, 35) */
task seqboolean := not seqboolean
/* CIF comment (781, 974), (279, 35) */
comment 'check NOT on a SEQUENCE of BOOLEAN';
/* CIF task (555, 1027), (162, 56) */
task for x in seqboolean:
call writeln(x);
endfor;
/* CIF TASK (573, 1064), (126, 38) */
TASK fixed := 'hello';
/* CIF TASK (561, 1117), (149, 35) */
TASK variable := 'HELLO';
/* CIF PROCEDURECALL (548, 1167), (176, 35) */
CALL writeln(variable // '!!!');
/* CIF PROCEDURECALL (500, 1217), (272, 35) */
CALL writeln(variable // variable // variable);
/* CIF TASK (590, 1267), (91, 35) */
TASK seq := {1};
/* CIF TASK (559, 1317), (153, 35) */
TASK seq := {1} // {2} // {3};
/* CIF TASK (550, 1367), (172, 35) */
TASK seq := seq // {2} // {1};
/* CIF DECISION (601, 1417), (70, 50) */
DECISION any;
/* CIF ANSWER (560, 1487), (70, 23) */
('a'):
/* CIF ANSWER (655, 1487), (70, 23) */
('b'):
ENDDECISION;
/* CIF DECISION (591, 1525), (89, 50) */
DECISION myenum
/* CIF COMMENT (718, 1533), (183, 35) */
COMMENT 'Check case insensitivity';
/* CIF ANSWER (528, 1595), (70, 23) */
(a):
/* CIF ANSWER (608, 1595), (70, 23) */
(B):
/* CIF ANSWER (688, 1595), (70, 23) */
(c):
/* CIF ANSWER (768, 1595), (70, 23) */
(d):
/* CIF ANSWER (848, 1595), (70, 23) */
(Ee):
ENDDECISION;
/* CIF DECISION (567, 1633), (138, 50) */
DECISION present(choice)
/* CIF COMMENT (743, 1641), (183, 35) */
COMMENT 'Check case insensitivity';
/* CIF ANSWER (555, 1703), (70, 23) */
(cde2):
/* CIF ANSWER (635, 1703), (70, 23) */
ELSE:
ENDDECISION;
/* CIF NEXTSTATE (578, 1741), (116, 33) */
/* CIF task (573, 1101), (126, 38) */
task fixed := 'hello';
/* CIF task (561, 1154), (149, 35) */
task variable := 'HELLO';
/* CIF PROCEDURECALL (548, 1204), (176, 35) */
call writeln(variable // '!!!');
/* CIF PROCEDURECALL (500, 1254), (272, 35) */
call writeln(variable // variable // variable);
/* CIF task (590, 1304), (91, 35) */
task seq := {1};
/* CIF task (559, 1354), (153, 35) */
task seq := {1} // {2} // {3};
/* CIF task (550, 1404), (172, 35) */
task seq := seq // {2} // {1};
/* CIF decision (601, 1454), (70, 50) */
decision any;
/* CIF ANSWER (508, 1524), (70, 24) */
('a'):
/* CIF PROCEDURECALL (455, 1568), (174, 35) */
call writeln('Random value a');
/* CIF ANSWER (693, 1524), (70, 24) */
('b'):
/* CIF PROCEDURECALL (640, 1568), (175, 35) */
call writeln('Random value b');
enddecision;
/* CIF decision (591, 1619), (89, 50) */
decision myenum
/* CIF comment (718, 1623), (183, 35) */
comment 'Check case insensitivity';
/* CIF ANSWER (528, 1689), (70, 24) */
(a):
/* CIF ANSWER (608, 1689), (70, 24) */
(B):
/* CIF ANSWER (688, 1689), (70, 24) */
(c):
/* CIF ANSWER (768, 1689), (70, 24) */
(d):
/* CIF ANSWER (848, 1689), (70, 24) */
(Ee):
enddecision;
/* CIF decision (567, 1729), (138, 50) */
decision present(choice)
/* CIF comment (743, 1732), (183, 35) */
comment 'Check case insensitivity';
/* CIF ANSWER (555, 1799), (70, 24) */
(cde2):
/* CIF ANSWER (635, 1799), (70, 24) */
ELSE:
enddecision;
/* CIF NEXTSTATE (578, 1839), (116, 33) */
NEXTSTATE Wait_for_GUI;
/* CIF STATE (1083, 427), (70, 35) */
STATE Third;
/* CIF INPUT (1054, 482), (130, 35) */
INPUT pulse(myenum);
/* CIF state (1083, 427), (70, 35) */
state Third;
/* CIF input (1054, 482), (130, 35) */
input pulse(myenum);
/* CIF NEXTSTATE (1062, 532), (113, 35) */
NEXTSTATE Wait_for_gui;
ENDSTATE;
/* CIF STATE (1059, 322), (123, 35) */
STATE AnotherState;
/* CIF INPUT (1053, 377), (130, 35) */
INPUT pulse(myenum);
endstate;
/* CIF state (1059, 322), (123, 35) */
state AnotherState;
/* CIF input (1053, 377), (130, 35) */
input pulse(myenum);
/* CIF NEXTSTATE (1083, 427), (70, 35) */
NEXTSTATE Third;
ENDSTATE;
/* CIF STATE (1063, 119), (116, 33) */
STATE Wait_for_GUI;
/* CIF INPUT (1056, 172), (130, 35) */
INPUT pulse(myenum);
endstate;
/* CIF state (1063, 119), (116, 33) */
state Wait_for_GUI;
/* CIF input (1056, 172), (130, 35) */
input pulse(myenum);
/* CIF PROCEDURECALL (994, 222), (253, 35) */
CALL writeln('Got PULSE', num(myenum));
/* CIF OUTPUT (1041, 272), (160, 35) */
OUTPUT telemetry(myenum);
call writeln('Got PULSE', num(myenum));
/* CIF output (1041, 272), (160, 35) */
output telemetry(myenum);
/* CIF NEXTSTATE (1059, 322), (123, 35) */
NEXTSTATE AnotherState;
ENDSTATE;
ENDPROCESS orchestrator;
\ No newline at end of file
endstate;
endprocess orchestrator;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment