Commit b7779022 authored by stancakapost's avatar stancakapost
Browse files

changed to use ptc-loopback to avoid dependence on loopback port test

adaptation implementation
parent ce6baf91
......@@ -34,9 +34,28 @@ module Sem_060210_ReuseofComponentTypes_002 {
inout float;
}
function loopback() runs on GeneralComp system GeneralComp {
var integer v_i;
var float v_f;
while (true) {
alt {
[] pt_myPortA.receive(integer:?) -> value v_i { pt_myPortA.send(v_i); }
[] pt_myPortA.receive(float:?) -> value v_f { pt_myPortA.send(v_f); }
[] pt_myPortB.receive(integer:?) -> value v_i { pt_myPortB.send(v_i); }
[] pt_myPortB.receive(float:?) -> value v_f { pt_myPortB.send(v_f); }
}
}
}
testcase TC_Sem_060210_ReuseofComponentTypes_002() runs on GeneralComp {
var GeneralComp v_server := GeneralComp.create;
connect(mtc:pt_myPortA, v_server:pt_myPortA);
connect(mtc:pt_myPortB, v_server:pt_myPortB);
v_server.start(loopback());
//Send an integer from pt_myPortA:
pt_myPortA.send(2);
alt {
......
......@@ -35,7 +35,27 @@ module Sem_060210_ReuseofComponentTypes_003 {
}
testcase TC_Sem_060210_ReuseofComponentTypes_003() runs on GeneralComp {
function loopback() runs on GeneralComp {
var integer v_i;
var float v_f;
while (true) {
alt {
[] pt_myPortA.receive(integer:?) -> value v_i { pt_myPortA.send(v_i); }
[] pt_myPortA.receive(float:?) -> value v_f { pt_myPortA.send(v_f); }
[] pt_myPortB.receive(integer:?) -> value v_i { pt_myPortB.send(v_i); }
[] pt_myPortB.receive(float:?) -> value v_f { pt_myPortB.send(v_f); }
}
}
}
testcase TC_Sem_060210_ReuseofComponentTypes_003() runs on GeneralComp system GeneralComp {
var GeneralComp v_server := GeneralComp.create;
connect(mtc:pt_myPortA, v_server:pt_myPortA);
connect(mtc:pt_myPortB, v_server:pt_myPortB);
v_server.start(loopback());
//Set a value to MyInt:
MyInt := 10;
......
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