Commit eef9b476 authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed select union for optional fields of records/sets (bug 559371)



Change-Id: I5cbf153abfc9a41978a4e5bdc87863ab76443dd8
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 1648fe7e
......@@ -6962,7 +6962,7 @@ error:
{
expression_struct expr;
Code::init_expr(&expr);
select_union.expr->generate_code_expr(&expr);
select_union.expr->generate_code_expr_mandatory(&expr);
if (expr.preamble) {
str = mputstr(str, expr.preamble);
}
......
......@@ -278,6 +278,37 @@ testcase tc_SelectUnionMultipleBranchesAnyType() runs on EmptyCT {
}
type set SetWithOptionalUnion
{
OptionalUnion u optional
}
type union OptionalUnion
{
integer int,
charstring str
}
testcase tc_SelectUnionForOptionalField() runs on EmptyCT {
var SetWithOptionalUnion x := {
u := {
int := 3
}
};
select union (x.u) {
case (int) {
setverdict(pass);
}
case (str) {
setverdict(fail, "Wrong alternative selected!");
}
case else {
setverdict(fail, "Invalid alternative selected!");
}
}
}
///////////////////////////////////////////////////////////////////////////////
......@@ -311,6 +342,7 @@ control {
execute(tc_SelectUnionAnyType());
execute(tc_SelectUnionMultipleBranches());
execute(tc_SelectUnionMultipleBranchesAnyType());
execute(tc_SelectUnionForOptionalField());
}
}
......@@ -320,4 +352,4 @@ with {
extension "anytype charstring, boolean, octetstring"
extension "anytype Messages"
encode "RAW";
}
\ No newline at end of file
}
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