diff --git a/compiler2/subtype.cc b/compiler2/subtype.cc index 0099ec9ae1f6f0920ba810dde37fb8d8a0036ba9..9d8e168f711d368198fa9da7845d5ead40f39069 100644 --- a/compiler2/subtype.cc +++ b/compiler2/subtype.cc @@ -17,6 +17,7 @@ * Raduly, Csaba * Szabados, Kristof * Szabo, Janos Zoltan – initial implementation + * Szabo, Bence Janos * Szalai, Gabor * Tatarka, Gabor * Zalanyi, Balazs Andor @@ -1978,6 +1979,8 @@ void SubType::chk_this_template(Template *templ) case Template::USTR_PATTERN: chk_this_template_pattern("universal charstring", templ); break; + case Template::TEMPLATE_NOTUSED: + break; case Template::TEMPLATE_ERROR: break; default: diff --git a/function_test/XER_EncDec/XER_EncDec_TD.script b/function_test/XER_EncDec/XER_EncDec_TD.script index 2a2981ba2cf481b969c96c3b081f2f072e869c67..7a0c238df3952b0a390029df406e58e278e3f0b9 100644 --- a/function_test/XER_EncDec/XER_EncDec_TD.script +++ b/function_test/XER_EncDec/XER_EncDec_TD.script @@ -8,6 +8,7 @@ .* Contributors: .* Balasko, Jeno .* Baranyi, Botond +.* Szabo, Bence Janos .* .******************************************************************************/ :text. @@ -67,6 +68,9 @@ A 2014-04-29 EBOTBAR New document .*---------------------------------------------------------------------* :h3. Encoding record with any element from unqualified namespace .*---------------------------------------------------------------------* +.*---------------------------------------------------------------------* +:h4. Encoding record template with explicitly unspecified field +.*---------------------------------------------------------------------* :xmp tab=0. <TC - Encoding record with any element from unqualified namespace> @@ -1229,6 +1233,51 @@ Dynamic test case error: While XER-decoding type '@Temp.any_elem_rec_of': Index :exmp. +.*---------------------------------------------------------------------* +:h4. Encoding record template with explicitly unspecified field +.*---------------------------------------------------------------------* +:xmp tab=0. + +<TC - Encoding record template with explicitly unspecified field> + +<STATIC> + +type component Test_CT{}; + +<TTCN_TC:PURE_EXEC> + +type record MyType +{ + universal charstring foo +} +with { + encode "XML"; + variant "element"; +}; + +external function ef_xer_enc(in MyType par) return octetstring + with { extension "prototype(convert) encode (XER:XER_EXTENDED) errorbehavior(ALL:ERROR)" } + +testcase tc_enc_explicitly_unspecified() runs on Test_CT { + template MyType myTemp := { foo := - }; + + var octetstring v_res := ef_xer_enc(valueof(myTemp)); + + setverdict(pass); +} + +control { + execute(tc_enc_explicitly_unspecified()); +} + +<RESULT> + +Dynamic test case error: Performing valueof or send operation on a non-specific template of type @Temp.MyType + +<END_TC> + +:exmp. + .*---------------------------------------------------------------------* :h1.REFERENCES .*---------------------------------------------------------------------*