Commit 727ab6e0 authored by BenceJanosSzabo's avatar BenceJanosSzabo
Browse files

Merge github.com:eclipse/titan.core

parents 91177082 7b14f920
......@@ -10576,17 +10576,19 @@ error:
}
label_r1:
// no break
case OPTYPE_UNDEF_RUNNING: // r1 [r2] b4
case OPTYPE_TMR_READ: { // r1
Common::Assignment *ass = u.expr.r1->get_refd_assignment();
self_ref |= (ass == lhs);
break; }
case OPTYPE_UNDEF_RUNNING: { // r1 [r2] b4
if (u.expr.r2 != NULL) {
Common::Assignment *ass = u.expr.r2->get_refd_assignment();
self_ref |= (ass == lhs);
Common::Assignment *ass2 = u.expr.r2->get_refd_assignment();
self_ref |= (ass2 == lhs);
}
// no break
case OPTYPE_TMR_READ: { // r1
Common::Assignment *ass = u.expr.r1->get_refd_assignment();
self_ref |= (ass == lhs);
break; }
case OPTYPE_ISCHOSEN_T: // t1 i2
case OPTYPE_ISBOUND: // ti1
case OPTYPE_ISVALUE: // ti1
......
......@@ -5304,7 +5304,7 @@ void defRecordTemplate1(const struct_def *sdef, output_struct *output)
src = mputprintf(src, "%s %s_template::valueof() const\n"
"{\n"
"if (template_selection != SPECIFIC_VALUE || is_ifpresent)\n"
"TTCN_error(\"Performing valueof or send operation on a non-specific "
"TTCN_error(\"Performing a valueof or send operation on a non-specific "
"template of type %s.\");\n"
"%s ret_val;\n", name, name, dispname, name);
for (i = 0; i < sdef->nElements; i++) {
......
......@@ -653,6 +653,8 @@ namespace Ttcn {
break;
case S_STOP_COMP:
case S_KILL:
delete comp_op.compref;
break;
case S_KILLED:
delete comp_op.compref;
delete comp_op.index_redirect;
......@@ -1349,6 +1351,9 @@ namespace Ttcn {
{
switch (statementtype) {
case S_DONE:
comp_op.donereturn.donematch = NULL;
comp_op.donereturn.redirect = NULL;
// no break
case S_KILLED:
comp_op.compref = 0;
comp_op.any_or_all = p_anyall;
......@@ -1814,6 +1819,8 @@ namespace Ttcn {
break;
case S_STOP_COMP:
case S_KILL:
if (comp_op.compref) comp_op.compref->set_my_scope(p_scope);
break;
case S_KILLED:
if (comp_op.compref) comp_op.compref->set_my_scope(p_scope);
if (comp_op.index_redirect != NULL) {
......@@ -2087,6 +2094,8 @@ namespace Ttcn {
break;
case S_STOP_COMP:
case S_KILL:
if (comp_op.compref) comp_op.compref->set_fullname(p_fullname+".compref");
break;
case S_KILLED:
if (comp_op.compref) comp_op.compref->set_fullname(p_fullname+".compref");
if (comp_op.index_redirect != NULL) {
......@@ -5683,6 +5692,8 @@ error:
break;
case S_STOP_COMP:
case S_KILL:
if (comp_op.compref) comp_op.compref->set_code_section(p_code_section);
break;
case S_KILLED:
if (comp_op.compref) comp_op.compref->set_code_section(p_code_section);
if (comp_op.index_redirect != NULL) {
......
......@@ -2640,7 +2640,7 @@ void defUnionTemplate(const struct_def *sdef, output_struct *output)
src = mputprintf(src, "%s %s_template::valueof() const\n"
"{\n"
"if (template_selection != SPECIFIC_VALUE || is_ifpresent)\n"
"TTCN_error(\"Performing valueof or send operation on a non-specific "
"TTCN_error(\"Performing a valueof or send operation on a non-specific "
"template of union type %s.\");\n"
"%s ret_val;\n"
"switch (single_value.union_selection) {\n", name, name, dispname, name);
......
......@@ -1122,7 +1122,7 @@ boolean CHARACTER_STRING_identification_template::match(const CHARACTER_STRING_i
CHARACTER_STRING_identification CHARACTER_STRING_identification_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of union type CHARACTER STRING.identification.");
TTCN_error("Performing a valueof or send operation on a non-specific template of union type CHARACTER STRING.identification.");
CHARACTER_STRING_identification ret_val;
switch (single_value.union_selection) {
case CHARACTER_STRING_identification::ALT_syntaxes:
......@@ -2112,7 +2112,7 @@ boolean CHARACTER_STRING_identification_syntaxes_template::match(const CHARACTER
CHARACTER_STRING_identification_syntaxes CHARACTER_STRING_identification_syntaxes_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type CHARACTER STRING.identification.syntaxes.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type CHARACTER STRING.identification.syntaxes.");
CHARACTER_STRING_identification_syntaxes ret_val;
ret_val.abstract() = single_value->field_abstract.valueof();
ret_val.transfer() = single_value->field_transfer.valueof();
......@@ -2845,7 +2845,7 @@ boolean CHARACTER_STRING_identification_context__negotiation_template::match(con
CHARACTER_STRING_identification_context__negotiation CHARACTER_STRING_identification_context__negotiation_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type CHARACTER STRING.identification.context-negotiation.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type CHARACTER STRING.identification.context-negotiation.");
CHARACTER_STRING_identification_context__negotiation ret_val;
ret_val.presentation__context__id() = single_value->field_presentation__context__id.valueof();
ret_val.transfer__syntax() = single_value->field_transfer__syntax.valueof();
......@@ -3730,7 +3730,7 @@ boolean CHARACTER_STRING_template::match(const CHARACTER_STRING& other_value,
CHARACTER_STRING CHARACTER_STRING_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type CHARACTER STRING.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type CHARACTER STRING.");
CHARACTER_STRING ret_val;
ret_val.identification() = single_value->field_identification.valueof();
if (single_value->field_data__value__descriptor.is_omit()) ret_val.data__value__descriptor() = OMIT_VALUE;
......
......@@ -1118,7 +1118,7 @@ boolean EMBEDDED_PDV_identification_template::match(const EMBEDDED_PDV_identific
EMBEDDED_PDV_identification EMBEDDED_PDV_identification_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of union type EMBEDDED PDV.identification.");
TTCN_error("Performing a valueof or send operation on a non-specific template of union type EMBEDDED PDV.identification.");
EMBEDDED_PDV_identification ret_val;
switch (single_value.union_selection) {
case EMBEDDED_PDV_identification::ALT_syntaxes:
......@@ -2116,7 +2116,7 @@ boolean EMBEDDED_PDV_identification_syntaxes_template::match(const EMBEDDED_PDV_
EMBEDDED_PDV_identification_syntaxes EMBEDDED_PDV_identification_syntaxes_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type EMBEDDED PDV.identification.syntaxes.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type EMBEDDED PDV.identification.syntaxes.");
EMBEDDED_PDV_identification_syntaxes ret_val;
ret_val.abstract() = single_value->field_abstract.valueof();
ret_val.transfer() = single_value->field_transfer.valueof();
......@@ -2857,7 +2857,7 @@ boolean EMBEDDED_PDV_identification_context__negotiation_template::match(const E
EMBEDDED_PDV_identification_context__negotiation EMBEDDED_PDV_identification_context__negotiation_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type EMBEDDED PDV.identification.context-negotiation.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type EMBEDDED PDV.identification.context-negotiation.");
EMBEDDED_PDV_identification_context__negotiation ret_val;
ret_val.presentation__context__id() = single_value->field_presentation__context__id.valueof();
ret_val.transfer__syntax() = single_value->field_transfer__syntax.valueof();
......@@ -3747,7 +3747,7 @@ boolean EMBEDDED_PDV_template::match(const EMBEDDED_PDV& other_value,
EMBEDDED_PDV EMBEDDED_PDV_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type EMBEDDED PDV.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type EMBEDDED PDV.");
EMBEDDED_PDV ret_val;
ret_val.identification() = single_value->field_identification.valueof();
if (single_value->field_data__value__descriptor.is_omit()) ret_val.data__value__descriptor() = OMIT_VALUE;
......
......@@ -1513,7 +1513,7 @@ boolean EXTERNAL_identification_template::match(const EXTERNAL_identification& o
EXTERNAL_identification EXTERNAL_identification_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of union type EXTERNAL.identification.");
TTCN_error("Performing a valueof or send operation on a non-specific template of union type EXTERNAL.identification.");
EXTERNAL_identification ret_val;
switch (single_value.union_selection) {
case EXTERNAL_identification::ALT_syntaxes:
......@@ -2418,7 +2418,7 @@ boolean EXTERNAL_identification_syntaxes_template::match(const EXTERNAL_identifi
EXTERNAL_identification_syntaxes EXTERNAL_identification_syntaxes_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type EXTERNAL.identification.syntaxes.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type EXTERNAL.identification.syntaxes.");
EXTERNAL_identification_syntaxes ret_val;
ret_val.abstract() = single_value->field_abstract.valueof();
ret_val.transfer() = single_value->field_transfer.valueof();
......@@ -3064,7 +3064,7 @@ boolean EXTERNAL_identification_context__negotiation_template::match(const EXTER
EXTERNAL_identification_context__negotiation EXTERNAL_identification_context__negotiation_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type EXTERNAL.identification.context-negotiation.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type EXTERNAL.identification.context-negotiation.");
EXTERNAL_identification_context__negotiation ret_val;
ret_val.presentation__context__id() = single_value->field_presentation__context__id.valueof();
ret_val.transfer__syntax() = single_value->field_transfer__syntax.valueof();
......@@ -3836,7 +3836,7 @@ boolean EXTERNAL_template::match(const EXTERNAL& other_value,
EXTERNAL EXTERNAL_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific template of type EXTERNAL.");
TTCN_error("Performing a valueof or send operation on a non-specific template of type EXTERNAL.");
EXTERNAL ret_val;
ret_val.identification() = single_value->field_identification.valueof();
if (single_value->field_data__value__descriptor.is_omit()) ret_val.data__value__descriptor() = OMIT_VALUE;
......
......@@ -1626,7 +1626,7 @@ boolean CHARSTRING::from_JSON_string(const char* p_value, size_t p_value_len, bo
}
}
// The charstring will be shorter than the JSON string, at least by the 2 quotes
// The resulting string (its length is less than or equal to end - start)
char* str = (char*)Malloc(end - start);
size_t len = 0;
boolean error = FALSE;
......@@ -2333,7 +2333,7 @@ boolean CHARSTRING_template::match(const CHARSTRING& other_value,
const CHARSTRING& CHARSTRING_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific "
TTCN_error("Performing a valueof or send operation on a non-specific "
"charstring template.");
return single_value;
}
......
......@@ -2421,9 +2421,9 @@ boolean UNIVERSAL_CHARSTRING::from_JSON_string(boolean check_quotes)
}
}
// The resulting string will be shorter than the JSON string, at least by the 2 quotes
universal_char* ustr = (universal_char*)Malloc((json_len - 2) * sizeof(universal_char));
memset(ustr, 0, sizeof(universal_char) * (json_len - 2));
// The resulting string (its length is less than or equal to end - start)
universal_char* ustr = (universal_char*)Malloc((end - start) * sizeof(universal_char));
memset(ustr, 0, sizeof(universal_char) * (end - start));
int ustr_len = 0;
boolean error = FALSE;
......@@ -4155,7 +4155,7 @@ boolean UNIVERSAL_CHARSTRING_template::match
const UNIVERSAL_CHARSTRING& UNIVERSAL_CHARSTRING_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing valueof or send operation on a non-specific "
TTCN_error("Performing a valueof or send operation on a non-specific "
"universal charstring template.");
return single_value;
}
......
......@@ -1455,7 +1455,7 @@ control {
<RESULT>
Dynamic test case error: Performing valueof or send operation on a non-specific template of type @Temp.MyType
Dynamic test case error: Performing a valueof or send operation on a non-specific template of type @Temp.MyType
<END_TC>
......
......@@ -175,9 +175,9 @@ testcase tc_attribute_union() runs on MTC {
// The decoder will attempt to decode each field and the first to successfully decode the value
// will be the selected one (thus the order of the fields is important)
testcase tc_attribute_as_value() runs on MTC {
var Stuff stuff := { { ival := 18 }, { osval := '1D66FE'O }, { csval := "almafa" }, { bval := true }, { fval := 1.8e-20}, { ucsval := "almácska" }, { bsval := '1101101'B }, { prodval := { name := "Shoe", price := 79.99, code := 'A4C'H } }, { roival := { 1, 3, 3, 7 } }, { prod2val := { "Car", 14000.0, omit } }, { sizeval := Large }, { unival := { hsval := 'EE0'H } }, { unival := { rocsval := { "one", "two", "ten" } } } };
var Stuff stuff := { { ival := 18 }, { osval := '1D66FE'O }, { csval := "almafa" }, { bval := true }, { fval := 1.8e-20}, { ucsval := "almácska" }, { bsval := '1101101'B }, { prodval := { name := "Shoe", price := 79.99, code := 'A4C'H } }, { roival := { 1, 3, 3, 7 } }, { prod2val := { "Car", 14000.0, omit } }, { sizeval := Large }, { unival := { hsval := 'EE0'H } }, { unival := { rocsval := { "one", "two", "ten" } } } };
var octetstring os := unichar2oct("[18,\"1D66FE\",\"almafa\",true,1.800000e-20,\"almácska\",\"1101101\",{\"name\":\"Shoe\",\"price\":79.990000,\"code\":\"A4C\"},[1,3,3,7],{\"name\":\"Car\",\"price\":14000.000000},\"Large\",\"EE0\",[\"one\",\"two\",\"ten\"]]", "UTF-8");
var octetstring os := unichar2oct("[18,\"1D66FE\",\"almafa\",true,1.800000e-20,\"almácska\",\"1101101\",{\"name\":\"Shoe\",\"price\":79.990000,\"code\":\"A4C\"},[1,3,3,7],{\"name\":\"Car\",\"price\":14000.000000},\"Large\",\"EE0\",[\"one\",\"two\",\"ten\"]]", "UTF-8");
f_check_encoding(encoded:= f_enc_stuff(stuff) , expected := os);
f_bool2verdict( match(f_dec_stuff(f_enc_stuff(stuff)), stuff) );
setverdict(pass);
......@@ -186,7 +186,7 @@ testcase tc_attribute_as_value() runs on MTC {
// Testing default values for record fields (decoding only)
testcase tc_attribute_default() runs on MTC {
var octetstring os := char2oct("{}");
var RecDef d := { i := -19, f := 1000000.000000, b := false, bs := '101'B, hs := 'DEAD'H, os := '1DE7'O, cs := "empty", ucs := "üres", size := Tiny, vt := fail };
var RecDef d := { i := -19, f := 1000000.000000, b := false, bs := '101'B, hs := 'DEAD'H, os := '1DE7'O, cs := "empty", ucs := "üres", size := Tiny, vt := fail };
f_bool2verdict( match(f_dec_def(os), d) );
os := char2oct("{ \"b\" : null }");
......@@ -365,7 +365,7 @@ control {
execute(tc_attribute_prettyprint2());
execute(tc_attribute_union());
execute(tc_attribute_as_value());
//execute(tc_attribute_default());
execute(tc_attribute_default());
execute(tc_attribute_as_value_asn());
execute(tc_attribute_optional_as_value());
execute(tc_attribute_metainfo_for_unbound());
......
......@@ -183,7 +183,7 @@ type record RecDef {
variant(f) "JSON:default(1.0e6)";
variant(size) "JSON:default(Tiny)";
variant(os) "JSON : default(1DE7)";
variant(ucs) "JSON:default(üres)";
variant(ucs) "JSON:default(üres)";
variant(bs) "JSON:default (101)";
variant(hs) "JSON:default(DEAD)";
variant(vt) "JSON:default(fail)";
......
......@@ -162,7 +162,7 @@ function f_behavior_sending(in template charstring pl_msg) runs on MyComp {
} else {
log("Catched error msg:", e);
if( isvalue(pl_msg) ) { setverdict(fail, "exception for sending real value");}
f_setverdict_str(e, pattern "*Performing valueof or send operation on a non-specific charstring template.");
f_setverdict_str(e, pattern "*Performing a valueof or send operation on a non-specific charstring template.");
@try {
PCO.send("Default msg");
}
......@@ -177,7 +177,7 @@ function f_behavior_sending(in template charstring pl_msg) runs on MyComp {
}
@catch(e) {
log("Catched DTE:",e);
f_setverdict_str(e, pattern "*Performing valueof or send operation on a non-specific charstring template.");
f_setverdict_str(e, pattern "*Performing a valueof or send operation on a non-specific charstring template.");
if(isvalue(pl_msg) ) {
setverdict(fail, "exception for valueof(real value template)");
......@@ -269,7 +269,7 @@ function f_valueof(in template charstring pl_msg) runs on MyComp {
}
@catch(e) {
log("Catched DTE:", e);
f_setverdict_str(e, pattern "*Performing valueof or send operation on a non-specific charstring template.");
f_setverdict_str(e, pattern "*Performing a valueof or send operation on a non-specific charstring template.");
if(isvalue(pl_msg) ) {
setverdict(fail, "exception for valueof of real value template");
......
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