Commit ab5d9228 authored by BenceJanosSzabo's avatar BenceJanosSzabo
Browse files

XER: embed value supporting field cannot be attribute (Bug 521828)



Change-Id: Id7bd6e7c13bdb6a6a6fbc04caf94d16e8cdcd299
Signed-off-by: default avatarBenceJanosSzabo <bence.janos.szabo@ericsson.com>
parent b8cb7f5a
......@@ -1489,7 +1489,7 @@ void Type::chk_xer_embed_values(int num_attributes)
enum complaint_type { ALL_GOOD, HAVE_DEFAULT, UNTAGGED_EMBEDVAL,
NOT_SEQUENCE, EMPTY_SEQUENCE, FIRST_NOT_SEQOF, SEQOF_NOT_STRING,
SEQOF_BAD_LENGTH, UNTAGGED_OTHER } ;
SEQOF_BAD_LENGTH, UNTAGGED_OTHER, ATTRIBUTE_EMBEDVAL } ;
complaint_type complaint = ALL_GOOD;
size_t expected_length = (size_t)-1;
Type *cf0t = 0; // type of first component
......@@ -1519,6 +1519,12 @@ void Type::chk_xer_embed_values(int num_attributes)
complaint = UNTAGGED_EMBEDVAL; // 25.2.2
break;
}
// Either the type of the field or the last_refd type of the field
if ((cf0->get_type()->xerattrib && cf0->get_type()->xerattrib->attribute_)
|| (cf0t->xerattrib && cf0t->xerattrib->attribute_)) {
complaint = ATTRIBUTE_EMBEDVAL;
break;
}
// Check length restriction on the record of. If there is one,
// it better be the correct number.
......@@ -1589,6 +1595,9 @@ void Type::chk_xer_embed_values(int num_attributes)
cf->error("There shall be no UNTAGGED on any character-encodable "
"component of a type with DEFAULT-FOR-EMPTY"); // 25.2.3
break;
case ATTRIBUTE_EMBEDVAL:
error("The SEQUENCE-OF supporting EMBED-VALUES must not have ATTRIBUTE.");
break;
} // switch(complaint)
} // if complaint and embedValues
}
......
/******************************************************************************
* Copyright (c) 2000-2017 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Szabo, Bence Janos
*
******************************************************************************/
module emb_first_attrib_SE { //^In TTCN-3 module `emb_first_attrib_SE'://
type record e1 { //^In type definition// //^error: The SEQUENCE\-OF supporting EMBED\-VALUES must not have ATTRIBUTE\.//
record of universal charstring field_1
}
with {
variant "embedValues"
variant (field_1) "attribute"
}
}
with {
encode "XML"
}
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