diff options
Diffstat (limited to 'tests/org.eclipse.etrice.generator.c.tests/model/SendingDataTest.room')
-rw-r--r-- | tests/org.eclipse.etrice.generator.c.tests/model/SendingDataTest.room | 954 |
1 files changed, 477 insertions, 477 deletions
diff --git a/tests/org.eclipse.etrice.generator.c.tests/model/SendingDataTest.room b/tests/org.eclipse.etrice.generator.c.tests/model/SendingDataTest.room index 5d522450f..8a6bedc7f 100644 --- a/tests/org.eclipse.etrice.generator.c.tests/model/SendingDataTest.room +++ b/tests/org.eclipse.etrice.generator.c.tests/model/SendingDataTest.room @@ -1,478 +1,478 @@ -RoomModel SendingDataTest { - - import room.basic.types.c.* from "CTypes.room" - - LogicalSystem LogSys_SendingData { - SubSystemRef application: SubSys_SendingData - } - - SubSystemClass SubSys_SendingData { - ActorRef top: SendingDataTop - } - - ActorClass SendingDataTop { - Structure { - ActorRef mrPong: MrPong - ActorRef ref0: MrPing - Binding ref0.PingPongPort and mrPong.PingPongPort - } - Behavior { } - } - - ActorClass MrPong { - Interface { - Port PingPongPort: PingPongProtocol - } - Structure { - external Port PingPongPort - } - Behavior { - StateMachine { - Transition tr0: reply -> reply { - triggers { - <pingInt16: PingPongPort> - } - action { - "PingPongPort.pongInt16(d);" - } - } - Transition tr1: reply -> reply { - triggers { - <pingInt8: PingPongPort> - } - action { - "PingPongPort.pongInt8(d);" - } - } - Transition init: initial -> reply { } - Transition tr2: reply -> reply { - triggers { - <pingInt32: PingPongPort> - } - action { - "PingPongPort.pongInt32(d);" - } - } - Transition tr3: reply -> reply { - triggers { - <pingFloat32: PingPongPort> - } - action { - "PingPongPort.pongFloat32(d);" - } - } - Transition tr4: reply -> reply { - triggers { - <pingFloat64: PingPongPort> - } - action { - "PingPongPort.pongFloat64(d);" - } - } - Transition tr7: reply -> cp cp0 { - triggers { - <pingInt32Ref: PingPongPort guard { - "d!=0" - }> - } - } - Transition tr8: cp cp0 -> reply { - action { - "PingPongPort.pongInt32(d+1);" - } - } - Transition tr6: cp cp0 -> reply { - cond { - "d!=5" - } - action { - "PingPongPort.pongInt32(d);" - } - } - Transition tr9: reply -> reply { - triggers { - <pingComplex: PingPongPort> - } - action { - "PingPongPort.pongComplex(d);" - } - } - Transition tr11: reply -> cp cp1 { - triggers { - <pingComplexRef: PingPongPort> - } - } - Transition tr10: cp cp1 -> reply { - action { - "d->i8Val++;" - "PingPongPort.pongComplex(d);" - } - } - Transition tr12: cp cp1 -> reply { - cond { - "(*d).i8Val!=0" - } - action { - "PingPongPort.pongComplex(d);" - } - } - ChoicePoint cp0 - ChoicePoint cp1 - State reply - } - } - } - - ActorClass MrPing { - Interface { - conjugated Port PingPongPort: PingPongProtocol - } - Structure { - usercode3 { - "#include \"etUnit/etUnit.h\"" - "#include \"SubSys_SendingData.h\"" - } - external Port PingPongPort - Attribute i32Array [ 10 ]: int32 - Attribute i32Val: int32 - Attribute i8ValAC:int8 - Attribute data: PingPongData - Attribute lastError: int32 = "0" - } - Behavior { - Operation checkData(d:PingPongData, mode:int8):int8{ - " - int8 result = 1; - if (mode == 0){ - if (d.i8Val != 10) result = 0; - if (*(d.i8ValRef) != 9) result = 0; - i8ValAC = 27; - if (d.i8Array[0] != 1) result = 0; - if (d.i8Array[1] != 2) result = 0; - if (d.i8Array[2] != 3) result = 0; - if (*(d.i8ArrayRef[0]) != 27) result = 0; - if (*(d.i8ArrayRef[1]) != 27) result = 0; - if (d.complexVal.i32Val1 != 127) result = 0; - if (d.complexVal.i32Val2 != 130) result = 0; - }else{ - if (d.i8Val != 50) result = 0; - if (*(d.i8ValRef) != 12) result = 0; - i8ValAC = 52; - if (d.i8Array[0] != 10) result = 0; - if (d.i8Array[1] != 20) result = 0; - if (d.i8Array[2] != 30) result = 0; - if (*(d.i8ArrayRef[0]) != 52) result = 0; - if (*(d.i8ArrayRef[1]) != 10) result = 0; - if (d.complexVal.i32Val1 != 150) result = 0; - if (d.complexVal.i32Val2 != 170) result = 0; - } - return result; - " - } - StateMachine { - Transition init: initial -> tp0 of waitForPong { - action { - "etUnit_openAll(\"tmp/testlog\",\"GeneratorTest1\", \"GeneratorTest1\", \"GeneratorTest1\");" - "static etInt16 resultlist[] = {1,2,3,4,5,6,7,8,9,10,50};" - "EXPECT_ORDER_START(resultlist, 11);" - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 1);" - "PingPongPort.pingInt8(8);" - "PingPongPort.pingInt16(16);" - "PingPongPort.pingInt32(32);" - } - } - Transition tr7: tp1 of waitForPong -> tp0 of waitForPongFloat { - action { - "PingPongPort.pingFloat32(32.76453653f);" - "PingPongPort.pingFloat64(64.12344354364533);" - } - } - Transition tr0: tp1 of waitForPongFloat -> tp0 of waitForPongRef - Transition tr4: tp1 of waitForComplex -> TestFinished - Transition tr2: tp1 of waitForPongRef -> tp0 of waitForComplex - State waitForPong { - subgraph { - Transition tr0: my tp0 -> state0 - Transition tr1: state0 -> cp cp0 { - triggers { - <pongInt8: PingPongPort> - } - } - Transition tr2: cp cp0 -> state1 { - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 0xFF);" - } - } - Transition E2: cp cp0 -> state1 { - cond { - "d==8" - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",2);" - } - } - Transition tr3: state2 -> cp cp1 { - triggers { - <pongInt32: PingPongPort> - } - } - Transition E4: cp cp1 -> my tp1 { - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 4);" - } - } - Transition tr4: cp cp1 -> my tp1 { - cond { - "d != 32" - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 0xFF);" - } - } - Transition tr5: state1 -> state2 { - triggers { - <pongInt16: PingPongPort> - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 0xFF);" - } - } - Transition E3: state1 -> state2 { - triggers { - <pongInt16: PingPongPort guard { - "d==16" - }> - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 3);" - } - } - ChoicePoint cp0 - ChoicePoint cp1 - EntryPoint tp0 - ExitPoint tp1 - State state0 - State state1 - State state2 - } - } - State TestFinished { - entry { - "EXPECT_ORDER_END(\"<|MODEL_LOCATION|>\\n\", 50);" - "etUnit_closeAll();" - "SubSys_SendingData_shutdown();" - } - } - State waitForPongFloat { - subgraph { - Transition tr0: my tp0 -> state0 - Transition tr1: state0 -> cp cp0 { - triggers { - <pongFloat32: PingPongPort> - } - } - Transition tr2: cp cp0 -> state1 { - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);" - } - } - Transition E5: cp cp0 -> state1 { - cond { - "((d>32)&&(d<33))" - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",5);" - } - } - Transition tr3: state1 -> cp cp1 { - triggers { - <pongFloat64: PingPongPort> - } - } - Transition tr4: cp cp1 -> my tp1 { - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);" - } - } - Transition E6: cp cp1 -> my tp1 { - cond { - "((d>64)&&(d<65))" - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",6);" - } - } - ChoicePoint cp0 - ChoicePoint cp1 - EntryPoint tp0 - ExitPoint tp1 - State state0 - State state1 - } - } - State waitForPongRef { - subgraph { - Transition tr0: my tp0 -> state0 { - action { - "i32Val=5;" - "PingPongPort.pingInt32Ref(&i32Val);" - "i32Val=10;" - "PingPongPort.pingInt32Ref(&i32Val);" - } - } - Transition E7: state0 -> state1 { - triggers { - <pongInt32: PingPongPort guard { - "d==10" - }> - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",7);" - } - } - Transition tr2: state0 -> state1 { - triggers { - <pongInt32: PingPongPort> - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);" - } - } - Transition E8: state1 -> my tp1 { - triggers { - <pongInt32: PingPongPort guard { - "d==10" - }> - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",8);" - } - } - Transition tr4: state1 -> my tp1 { - triggers { - <pongInt32: PingPongPort> - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);" - } - } - EntryPoint tp0 - ExitPoint tp1 - State state0 - State state1 - } - } - State waitForComplex { - subgraph { - Transition tr0: my tp0 -> state0 { - action { - "i8ValAC=7;" - "data.i8Val=10;" - "data.i8Array[0]=1;" - "data.i8Array[1]=2;" - "data.i8Array[2]=3;" - "data.i8ArrayRef[0]=&i8ValAC;" - "data.i8ArrayRef[1]=&i8ValAC;" - "data.i8ValRef=&i8ValAC;" - "data.complexVal.i32Val1=127;" - "data.complexVal.i32Val2=130;" - "PingPongPort.pingComplex(&data);" - "i8ValAC=9;" - "data.i8Val=12;" - } - } - Transition tr2: state0 -> cp cp0 { - triggers { - <pongComplex: PingPongPort> - } - } - Transition tr1: cp cp0 -> state1 { - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);" - } - } - Transition E9: cp cp0 -> state1 { - cond { - "checkData(*d,0)" - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",9);" - "" - "PingPongPort.pingComplexRef(&data);" - "" - "i8ValAC=12;" - "data.i8Val=50;" - "data.i8Array[0]=10;" - "data.i8Array[1]=20;" - "data.i8Array[2]=30;" - "data.i8ArrayRef[0]=&i8ValAC;" - "data.i8ArrayRef[1]=&(data.i8Array[0]);" - "data.i8ValRef=&i8ValAC;" - "data.complexVal.i32Val1=150;" - "data.complexVal.i32Val2=170;" - } - } - Transition tr3: state1 -> my tp1 { - triggers { - <pongComplex: PingPongPort> - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);" - } - } - Transition E10: state1 -> my tp1 { - triggers { - <pongComplex: PingPongPort guard { - "checkData(*d,1)" - }> - } - action { - "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",10);" - } - } - ChoicePoint cp0 - EntryPoint tp0 - ExitPoint tp1 - State state0 - State state1 - } - } - } - } - } - - ProtocolClass PingPongProtocol { - incoming { - Message pingInt8(d: int8) - Message pingInt16(d: int16) - Message pingInt32(d: int32) - Message pingFloat32(d: float32) - Message pingFloat64(d: float64) - Message pingInt32Ref(d: int32 ref) - Message pingComplex (d:PingPongData) - Message pingComplexRef (d:PingPongData ref) - } - outgoing { - Message pongInt8(d: int8) - Message pongInt16(d: int16) - Message pongInt32(d: int32) - Message pongFloat32(d: float32) - Message pongFloat64(d: float64) - Message pongComplex(d:PingPongData) - } - } - - DataClass PingPongData { - Attribute i8Val:int8 - Attribute i8ValRef:int8 ref - Attribute i8Array [3] :int8 - Attribute i8ArrayRef [2] : int8 ref - Attribute complexVal: PingPongDataDeep - } - - DataClass PingPongDataDeep { - Attribute i32Val1:int32 - Attribute i32Val2:int32 - } - +RoomModel SendingDataTest {
+
+ import room.basic.types.c.* from "CTypes.room"
+
+ LogicalSystem LogSys_SendingData {
+ SubSystemRef application: SubSys_SendingData
+ }
+
+ SubSystemClass SubSys_SendingData {
+ ActorRef top: SendingDataTop
+ }
+
+ ActorClass SendingDataTop {
+ Structure {
+ ActorRef mrPong: MrPong
+ ActorRef ref0: MrPing
+ Binding ref0.PingPongPort and mrPong.PingPongPort
+ }
+ Behavior { }
+ }
+
+ ActorClass MrPong {
+ Interface {
+ Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ }
+ Behavior {
+ StateMachine {
+ Transition tr0: reply -> reply {
+ triggers {
+ <pingInt16: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt16(d);"
+ }
+ }
+ Transition tr1: reply -> reply {
+ triggers {
+ <pingInt8: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt8(d);"
+ }
+ }
+ Transition init: initial -> reply { }
+ Transition tr2: reply -> reply {
+ triggers {
+ <pingInt32: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt32(d);"
+ }
+ }
+ Transition tr3: reply -> reply {
+ triggers {
+ <pingFloat32: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongFloat32(d);"
+ }
+ }
+ Transition tr4: reply -> reply {
+ triggers {
+ <pingFloat64: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongFloat64(d);"
+ }
+ }
+ Transition tr7: reply -> cp cp0 {
+ triggers {
+ <pingInt32Ref: PingPongPort guard {
+ "d!=0"
+ }>
+ }
+ }
+ Transition tr8: cp cp0 -> reply {
+ action {
+ "PingPongPort.pongInt32(d+1);"
+ }
+ }
+ Transition tr6: cp cp0 -> reply {
+ cond {
+ "d!=5"
+ }
+ action {
+ "PingPongPort.pongInt32(d);"
+ }
+ }
+ Transition tr9: reply -> reply {
+ triggers {
+ <pingComplex: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongComplex(d);"
+ }
+ }
+ Transition tr11: reply -> cp cp1 {
+ triggers {
+ <pingComplexRef: PingPongPort>
+ }
+ }
+ Transition tr10: cp cp1 -> reply {
+ action {
+ "d->i8Val++;"
+ "PingPongPort.pongComplex(d);"
+ }
+ }
+ Transition tr12: cp cp1 -> reply {
+ cond {
+ "(*d).i8Val!=0"
+ }
+ action {
+ "PingPongPort.pongComplex(d);"
+ }
+ }
+ ChoicePoint cp0
+ ChoicePoint cp1
+ State reply
+ }
+ }
+ }
+
+ ActorClass MrPing {
+ Interface {
+ conjugated Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ usercode3 {
+ "#include \"etUnit/etUnit.h\""
+ "#include \"SubSys_SendingData.h\""
+ }
+ external Port PingPongPort
+ Attribute i32Array [ 10 ]: int32
+ Attribute i32Val: int32
+ Attribute i8ValAC:int8
+ Attribute data: PingPongData
+ Attribute lastError: int32 = "0"
+ }
+ Behavior {
+ Operation checkData(d:PingPongData, mode:int8):int8{
+ "
+ int8 result = 1;
+ if (mode == 0){
+ if (d.i8Val != 10) result = 0;
+ if (*(d.i8ValRef) != 9) result = 0;
+ i8ValAC = 27;
+ if (d.i8Array[0] != 1) result = 0;
+ if (d.i8Array[1] != 2) result = 0;
+ if (d.i8Array[2] != 3) result = 0;
+ if (*(d.i8ArrayRef[0]) != 27) result = 0;
+ if (*(d.i8ArrayRef[1]) != 27) result = 0;
+ if (d.complexVal.i32Val1 != 127) result = 0;
+ if (d.complexVal.i32Val2 != 130) result = 0;
+ }else{
+ if (d.i8Val != 50) result = 0;
+ if (*(d.i8ValRef) != 12) result = 0;
+ i8ValAC = 52;
+ if (d.i8Array[0] != 10) result = 0;
+ if (d.i8Array[1] != 20) result = 0;
+ if (d.i8Array[2] != 30) result = 0;
+ if (*(d.i8ArrayRef[0]) != 52) result = 0;
+ if (*(d.i8ArrayRef[1]) != 10) result = 0;
+ if (d.complexVal.i32Val1 != 150) result = 0;
+ if (d.complexVal.i32Val2 != 170) result = 0;
+ }
+ return result;
+ "
+ }
+ StateMachine {
+ Transition init: initial -> tp0 of waitForPong {
+ action {
+ "etUnit_openAll(\"tmp/testlog\",\"GeneratorTest1\", \"GeneratorTest1\", \"GeneratorTest1\");"
+ "static etInt16 resultlist[] = {1,2,3,4,5,6,7,8,9,10,50};"
+ "EXPECT_ORDER_START(resultlist, 11);"
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 1);"
+ "PingPongPort.pingInt8(8);"
+ "PingPongPort.pingInt16(16);"
+ "PingPongPort.pingInt32(32);"
+ }
+ }
+ Transition tr7: tp1 of waitForPong -> tp0 of waitForPongFloat {
+ action {
+ "PingPongPort.pingFloat32(32.76453653f);"
+ "PingPongPort.pingFloat64(64.12344354364533);"
+ }
+ }
+ Transition tr0: tp1 of waitForPongFloat -> tp0 of waitForPongRef
+ Transition tr4: tp1 of waitForComplex -> TestFinished
+ Transition tr2: tp1 of waitForPongRef -> tp0 of waitForComplex
+ State waitForPong {
+ subgraph {
+ Transition tr0: my tp0 -> state0
+ Transition tr1: state0 -> cp cp0 {
+ triggers {
+ <pongInt8: PingPongPort>
+ }
+ }
+ Transition tr2: cp cp0 -> state1 {
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 0xFF);"
+ }
+ }
+ Transition E2: cp cp0 -> state1 {
+ cond {
+ "d==8"
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",2);"
+ }
+ }
+ Transition tr3: state2 -> cp cp1 {
+ triggers {
+ <pongInt32: PingPongPort>
+ }
+ }
+ Transition E4: cp cp1 -> my tp1 {
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 4);"
+ }
+ }
+ Transition tr4: cp cp1 -> my tp1 {
+ cond {
+ "d != 32"
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 0xFF);"
+ }
+ }
+ Transition tr5: state1 -> state2 {
+ triggers {
+ <pongInt16: PingPongPort>
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 0xFF);"
+ }
+ }
+ Transition E3: state1 -> state2 {
+ triggers {
+ <pongInt16: PingPongPort guard {
+ "d==16"
+ }>
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\", 3);"
+ }
+ }
+ ChoicePoint cp0
+ ChoicePoint cp1
+ EntryPoint tp0
+ ExitPoint tp1
+ State state0
+ State state1
+ State state2
+ }
+ }
+ State TestFinished {
+ entry {
+ "EXPECT_ORDER_END(\"<|MODEL_LOCATION|>\\n\", 50);"
+ "etUnit_closeAll();"
+ " SubSysClass_shutdown();"
+ }
+ }
+ State waitForPongFloat {
+ subgraph {
+ Transition tr0: my tp0 -> state0
+ Transition tr1: state0 -> cp cp0 {
+ triggers {
+ <pongFloat32: PingPongPort>
+ }
+ }
+ Transition tr2: cp cp0 -> state1 {
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);"
+ }
+ }
+ Transition E5: cp cp0 -> state1 {
+ cond {
+ "((d>32)&&(d<33))"
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",5);"
+ }
+ }
+ Transition tr3: state1 -> cp cp1 {
+ triggers {
+ <pongFloat64: PingPongPort>
+ }
+ }
+ Transition tr4: cp cp1 -> my tp1 {
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);"
+ }
+ }
+ Transition E6: cp cp1 -> my tp1 {
+ cond {
+ "((d>64)&&(d<65))"
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",6);"
+ }
+ }
+ ChoicePoint cp0
+ ChoicePoint cp1
+ EntryPoint tp0
+ ExitPoint tp1
+ State state0
+ State state1
+ }
+ }
+ State waitForPongRef {
+ subgraph {
+ Transition tr0: my tp0 -> state0 {
+ action {
+ "i32Val=5;"
+ "PingPongPort.pingInt32Ref(&i32Val);"
+ "i32Val=10;"
+ "PingPongPort.pingInt32Ref(&i32Val);"
+ }
+ }
+ Transition E7: state0 -> state1 {
+ triggers {
+ <pongInt32: PingPongPort guard {
+ "d==10"
+ }>
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",7);"
+ }
+ }
+ Transition tr2: state0 -> state1 {
+ triggers {
+ <pongInt32: PingPongPort>
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);"
+ }
+ }
+ Transition E8: state1 -> my tp1 {
+ triggers {
+ <pongInt32: PingPongPort guard {
+ "d==10"
+ }>
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",8);"
+ }
+ }
+ Transition tr4: state1 -> my tp1 {
+ triggers {
+ <pongInt32: PingPongPort>
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);"
+ }
+ }
+ EntryPoint tp0
+ ExitPoint tp1
+ State state0
+ State state1
+ }
+ }
+ State waitForComplex {
+ subgraph {
+ Transition tr0: my tp0 -> state0 {
+ action {
+ "i8ValAC=7;"
+ "data.i8Val=10;"
+ "data.i8Array[0]=1;"
+ "data.i8Array[1]=2;"
+ "data.i8Array[2]=3;"
+ "data.i8ArrayRef[0]=&i8ValAC;"
+ "data.i8ArrayRef[1]=&i8ValAC;"
+ "data.i8ValRef=&i8ValAC;"
+ "data.complexVal.i32Val1=127;"
+ "data.complexVal.i32Val2=130;"
+ "PingPongPort.pingComplex(&data);"
+ "i8ValAC=9;"
+ "data.i8Val=12;"
+ }
+ }
+ Transition tr2: state0 -> cp cp0 {
+ triggers {
+ <pongComplex: PingPongPort>
+ }
+ }
+ Transition tr1: cp cp0 -> state1 {
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);"
+ }
+ }
+ Transition E9: cp cp0 -> state1 {
+ cond {
+ "checkData(*d,0)"
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",9);"
+ ""
+ "PingPongPort.pingComplexRef(&data);"
+ ""
+ "i8ValAC=12;"
+ "data.i8Val=50;"
+ "data.i8Array[0]=10;"
+ "data.i8Array[1]=20;"
+ "data.i8Array[2]=30;"
+ "data.i8ArrayRef[0]=&i8ValAC;"
+ "data.i8ArrayRef[1]=&(data.i8Array[0]);"
+ "data.i8ValRef=&i8ValAC;"
+ "data.complexVal.i32Val1=150;"
+ "data.complexVal.i32Val2=170;"
+ }
+ }
+ Transition tr3: state1 -> my tp1 {
+ triggers {
+ <pongComplex: PingPongPort>
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",0xFF);"
+ }
+ }
+ Transition E10: state1 -> my tp1 {
+ triggers {
+ <pongComplex: PingPongPort guard {
+ "checkData(*d,1)"
+ }>
+ }
+ action {
+ "EXPECT_ORDER(\"<|MODEL_LOCATION|>\\\\n\",10);"
+ }
+ }
+ ChoicePoint cp0
+ EntryPoint tp0
+ ExitPoint tp1
+ State state0
+ State state1
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message pingInt8(d: int8)
+ Message pingInt16(d: int16)
+ Message pingInt32(d: int32)
+ Message pingFloat32(d: float32)
+ Message pingFloat64(d: float64)
+ Message pingInt32Ref(d: int32 ref)
+ Message pingComplex (d:PingPongData)
+ Message pingComplexRef (d:PingPongData ref)
+ }
+ outgoing {
+ Message pongInt8(d: int8)
+ Message pongInt16(d: int16)
+ Message pongInt32(d: int32)
+ Message pongFloat32(d: float32)
+ Message pongFloat64(d: float64)
+ Message pongComplex(d:PingPongData)
+ }
+ }
+
+ DataClass PingPongData {
+ Attribute i8Val:int8
+ Attribute i8ValRef:int8 ref
+ Attribute i8Array [3] :int8
+ Attribute i8ArrayRef [2] : int8 ref
+ Attribute complexVal: PingPongDataDeep
+ }
+
+ DataClass PingPongDataDeep {
+ Attribute i32Val1:int32
+ Attribute i32Val2:int32
+ }
+
}
\ No newline at end of file |