Skip to content
Snippets Groups Projects
Commit 13550944 authored by BenceJanosSzabo's avatar BenceJanosSzabo
Browse files

Correction of mtc and system compatibility


Change-Id: I5cac38389c492a8be19c240bb4b4a03fb303bb10
Signed-off-by: default avatarBenceJanosSzabo <bence.janos.szabo@ericsson.com>
parent 0cb40f9a
No related branches found
No related tags found
No related merge requests found
......@@ -3714,7 +3714,7 @@ namespace Common {
}
ComponentTypeBody* b1 = t1->get_CompBody();
ComponentTypeBody* b2 = t2->get_CompBody();
// Does b2 contains every port with the same type and name as b1?
for (size_t i = 0; i < b1->get_nof_asss(); i++) {
Assignment * ass = b1->get_ass_byIndex(i);
......@@ -3741,32 +3741,6 @@ namespace Common {
}
}
// Does b1 contains every port with the same type and name as b2?
for (size_t i = 0; i < b2->get_nof_asss(); i++) {
Assignment * ass = b2->get_ass_byIndex(i);
if (ass->get_asstype() == Assignment::A_PORT) {
Type *port_type = ass->get_Type()->get_type_refd_last();
const Identifier& id = ass->get_id();
bool found = false;
for (size_t j = 0; j < b1->get_nof_asss(); j++) {
Assignment * ass2 = b1->get_ass_byIndex(j);
const Identifier& id2 = ass2->get_id();
if (id == id2 && ass2->get_asstype() == Assignment::A_PORT) {
Type *port_type2 = ass2->get_Type()->get_type_refd_last();
if (port_type != port_type2) {
return false;
} else {
found = true;
break;
}
}
}
if (!found) {
return false;
}
}
}
return true;
}
......
......@@ -25,6 +25,13 @@ module MtcSystemClause_SE { //^In TTCN-3 module//
}
type component Comp2 {
var integer i;
port P1 p1;
port P1 p2; /* Different name */
timer mytimer;
}
type component Comp3 {
var integer i;
port P1 p2; /* Different name */
timer mytimer;
......@@ -57,19 +64,38 @@ module MtcSystemClause_SE { //^In TTCN-3 module//
}
}
altstep alt_diff_mtc_bad() runs on Comp2 mtc Comp1 {
altstep alt_diff_mtc2() runs on Comp2 mtc Comp1 {
[]mytimer.timeout{
}
}
altstep alt_diff_system2() runs on Comp2 system Comp1 {
[]mytimer.timeout{
}
}
altstep alt_diff_mtc_and_system2() runs on Comp2 mtc Comp1 system Comp1 {
[]mytimer.timeout{
}
}
altstep alt_diff_system_bad() runs on Comp2 system Comp1 {
altstep alt_diff_mtc_bad() runs on Comp3 mtc Comp1 {
[]mytimer.timeout{
}
}
altstep alt_diff_mtc_and_system_bad() runs on Comp2 mtc Comp1 system Comp1 {
altstep alt_diff_system_bad() runs on Comp3 system Comp1 {
[]mytimer.timeout{
}
}
altstep alt_diff_mtc_and_system_bad() runs on Comp3 mtc Comp1 system Comp1 {
[]mytimer.timeout{
}
......@@ -87,14 +113,24 @@ module MtcSystemClause_SE { //^In TTCN-3 module//
alt_diff_mtc_and_system();
}
testcase tc_negative() runs on Comp2 system Comp2 { //^In testcase definition \`tc_negative\'\://
diff_mtc(); //^In function instance\:// //^error\: Mtc clause mismatch\: A definition that runs on component type \`\@MtcSystemClause_SE\.Comp2\' cannot call function \`\@MtcSystemClause_SE\.diff_mtc\'\, which mtc clause is \`\@MtcSystemClause_SE\.Comp1\'//
diff_system(); //^In function instance\:// //^error\: System clause mismatch\: A definition with system component type \`\@MtcSystemClause_SE\.Comp2\' cannot call function \`\@MtcSystemClause_SE\.diff_system\'\, which system clause is \`\@MtcSystemClause_SE\.Comp1\'//
diff_mtc_and_system(); //^In function instance\:// //^error\: System clause mismatch\: A definition with system component type \`\@MtcSystemClause_SE\.Comp2\' cannot call function \`\@MtcSystemClause_SE\.diff_mtc_and_system\'\, which system clause is \`\@MtcSystemClause_SE\.Comp1\'// //^error\: Mtc clause mismatch\: A definition that runs on component type \`\@MtcSystemClause_SE\.Comp2\' cannot call function \`\@MtcSystemClause_SE\.diff_mtc_and_system\'\, which mtc clause is \`\@MtcSystemClause_SE\.Comp1\'//
testcase tc_positive2() runs on Comp2 system Comp2 {
diff_mtc();
diff_system();
diff_mtc_and_system();
alt_diff_mtc2();
alt_diff_system2();
alt_diff_mtc_and_system2();
}
testcase tc_negative() runs on Comp3 system Comp3 { //^In testcase definition \`tc_negative\'\://
diff_mtc(); //^In function instance\:// //^error\: Mtc clause mismatch\: A definition that runs on component type \`\@MtcSystemClause_SE\.Comp3\' cannot call function \`\@MtcSystemClause_SE\.diff_mtc\'\, which mtc clause is \`\@MtcSystemClause_SE\.Comp1\'//
diff_system(); //^In function instance\:// //^error\: System clause mismatch\: A definition with system component type \`\@MtcSystemClause_SE\.Comp3\' cannot call function \`\@MtcSystemClause_SE\.diff_system\'\, which system clause is \`\@MtcSystemClause_SE\.Comp1\'//
diff_mtc_and_system(); //^In function instance\:// //^error\: System clause mismatch\: A definition with system component type \`\@MtcSystemClause_SE\.Comp3\' cannot call function \`\@MtcSystemClause_SE\.diff_mtc_and_system\'\, which system clause is \`\@MtcSystemClause_SE\.Comp1\'// //^error\: Mtc clause mismatch\: A definition that runs on component type \`\@MtcSystemClause_SE\.Comp3\' cannot call function \`\@MtcSystemClause_SE\.diff_mtc_and_system\'\, which mtc clause is \`\@MtcSystemClause_SE\.Comp1\'//
alt_diff_mtc_bad(); //^In altstep instance\:// //^error\: Mtc clause mismatch\: A definition that runs on component type \`\@MtcSystemClause_SE\.Comp2\' cannot call altstep \`\@MtcSystemClause_SE\.alt_diff_mtc_bad\'\, which mtc clause is \`\@MtcSystemClause_SE\.Comp1\'//
alt_diff_system_bad(); //^In altstep instance\:// //^error\: System clause mismatch\: A definition with system component type \`\@MtcSystemClause_SE\.Comp2\' cannot call altstep \`\@MtcSystemClause_SE\.alt_diff_system_bad\'\, which system clause is \`\@MtcSystemClause_SE\.Comp1\'//
alt_diff_mtc_and_system_bad(); //^In altstep instance\:// //^error\: System clause mismatch\: A definition with system component type \`\@MtcSystemClause_SE\.Comp2\' cannot call altstep \`\@MtcSystemClause_SE\.alt_diff_mtc_and_system_bad\'\, which system clause is \`\@MtcSystemClause_SE\.Comp1\'// //^error\: Mtc clause mismatch\: A definition that runs on component type \`\@MtcSystemClause_SE\.Comp2\' cannot call altstep \`\@MtcSystemClause_SE\.alt_diff_mtc_and_system_bad\'\, which mtc clause is \`\@MtcSystemClause_SE\.Comp1\'//
alt_diff_mtc_bad(); //^In altstep instance\:// //^error\: Mtc clause mismatch\: A definition that runs on component type \`\@MtcSystemClause_SE\.Comp3\' cannot call altstep \`\@MtcSystemClause_SE\.alt_diff_mtc_bad\'\, which mtc clause is \`\@MtcSystemClause_SE\.Comp1\'//
alt_diff_system_bad(); //^In altstep instance\:// //^error\: System clause mismatch\: A definition with system component type \`\@MtcSystemClause_SE\.Comp3\' cannot call altstep \`\@MtcSystemClause_SE\.alt_diff_system_bad\'\, which system clause is \`\@MtcSystemClause_SE\.Comp1\'//
alt_diff_mtc_and_system_bad(); //^In altstep instance\:// //^error\: System clause mismatch\: A definition with system component type \`\@MtcSystemClause_SE\.Comp3\' cannot call altstep \`\@MtcSystemClause_SE\.alt_diff_mtc_and_system_bad\'\, which system clause is \`\@MtcSystemClause_SE\.Comp1\'// //^error\: Mtc clause mismatch\: A definition that runs on component type \`\@MtcSystemClause_SE\.Comp3\' cannot call altstep \`\@MtcSystemClause_SE\.alt_diff_mtc_and_system_bad\'\, which mtc clause is \`\@MtcSystemClause_SE\.Comp1\'//
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment