Implicit omit doesn't work inside optional fields of records/sets
Copy of titan.core#588 (closed)
Summary
The "implicit omit" extension for optional fields is not applied inside optional fields that are present (i.e. not unbound or omitted).
Steps and/or TTCN-3 code to reproduce
TTCN module:
module test {
type record EmbeddedRecord {
charstring originalField,
charstring newEmbeddedField optional
}
type record Record {
integer int,
charstring newTopLevelField optional,
EmbeddedRecord eRec,
EmbeddedRecord eRec2 optional
}
modulepar Record mp_record with {optional "implicit omit"}
type component MAIN_CT {}
testcase tc_ImplicitOmit() runs on MAIN_CT {
action("mp_record is: ", mp_record);
if(mp_record.newTopLevelField == omit) {
setverdict(pass, "mp_record.newTopLevelField is omit");
} else {
setverdict(fail, "mp_record.newTopLevelField is not omit!");
}
if(mp_record.eRec.newEmbeddedField == omit) {
setverdict(pass, "mp_record.eRec.newEmbeddedField is omit");
} else {
setverdict(fail, "mp_record.eRec.newEmbeddedField is not omit!");
}
if(mp_record.eRec2.newEmbeddedField == omit) {
setverdict(pass, "mp_record.eRec2.newEmbeddedField is omit");
} else {
setverdict(fail, "mp_record.eRec2.newEmbeddedField is not omit!");
}
}
control {
execute(tc_ImplicitOmit());
}
}
Configuration file:
[MODULE_PARAMETERS]
mp_record := { int := 1, eRec := { originalField := "originalField" }, eRec2 := { originalField := "originalField2" } }
[EXECUTE]
test
What is the current bug behavior?
Field 'mp_record.eRec2.newEmbeddedField' is left unbound. The other optional fields are correctly set to 'omit'.
What is the expected correct behavior?
Field 'mp_record.eRec2.newEmbeddedField' should be omitted instead of unbound.
Relevant logs and/or screenshots
Possible fixes
Titan version
8.1.0
Platform details (OS type and version)
Ubuntu 20.04
/cc @aknappqwt