diff --git a/regression_test/connectMapOperTest/ConnectMapOperNegTest.ttcn b/regression_test/connectMapOperTest/ConnectMapOperNegTest.ttcn index 702b87277a5faeb1c76a69b0f84b2f213015a531..078983b4f936ee8e2d7f84afa052cc45b61d779c 100644 --- a/regression_test/connectMapOperTest/ConnectMapOperNegTest.ttcn +++ b/regression_test/connectMapOperTest/ConnectMapOperNegTest.ttcn @@ -20,20 +20,21 @@ module ConnectMapOperNegTest { port loopbackPort p2; } - type component System { + type component System_ { port loopbackPort p1; port loopbackPort p2; } - testcase tc_neg_connect_after_map() runs on GeneralComp system System { + testcase tc_neg_connect_after_map() runs on GeneralComp system System_ { map(self:p1, system:p1); + template charstring t_expected := pattern "*Dynamic test case error: Connect operation cannot be performed on a mapped port \(p1\).*" @try { connect(self:p1, self:p2); setverdict(fail, "Connect operation succeeded. Expected error."); } @catch (msg) { - if (match(msg, "Dynamic test case error: Connect operation cannot be performed on a mapped port (p1).")) { + if (match(msg, t_expected)) { setverdict(pass); } else { @@ -43,15 +44,16 @@ module ConnectMapOperNegTest { setverdict(pass); } - testcase tc_neg_connect_after_map2() runs on GeneralComp system System { + testcase tc_neg_connect_after_map2() runs on GeneralComp system System_ { var GeneralComp v_comp := GeneralComp.create; + template charstring t_expected := pattern "*Dynamic test case error: Connect operation cannot be performed on a mapped port \(p1\).*" map(self:p1, system:p1); @try { connect(self:p1, v_comp:p2); setverdict(fail, "Connect operation succeeded. Expected error."); } @catch (msg) { - if (match(msg, "Dynamic test case error: Connect operation cannot be performed on a mapped port (p1).")) { + if (match(msg, t_expected)) { setverdict(pass); } else { @@ -61,15 +63,16 @@ module ConnectMapOperNegTest { setverdict(pass); } - testcase tc_neg_map_after_connect() runs on GeneralComp system System { + testcase tc_neg_map_after_connect() runs on GeneralComp system System_ { var GeneralComp v_comp := GeneralComp.create; + template charstring t_expected := pattern "*Dynamic test case error: Map operation is not allowed on a connected port \(p1\)." connect(self:p1, v_comp:p2); @try { map(self:p1, system:p1); setverdict(fail, "Connect operation succeeded. Expected error."); } @catch (msg) { - if (match(msg, "Dynamic test case error: Map operation is not allowed on a connected port (p1).")) { + if (match(msg, t_expected)) { setverdict(pass); } else { @@ -82,7 +85,6 @@ module ConnectMapOperNegTest { control{ execute(tc_neg_connect_after_map()); execute(tc_neg_connect_after_map2()); - execute(tc_neg_map_after_connect()); } } \ No newline at end of file