Home » Eclipse Projects » Eclipse Titan » more strict 'ifpresent' handling in titan 6.6.x compared to previous versions
more strict 'ifpresent' handling in titan 6.6.x compared to previous versions [message #1826175] |
Mon, 20 April 2020 11:44  |
Eclipse User |
|
|
|
I just wanted to upgrade the Osmocom test suites from TITAN 6.5.0 to 6.6.1 yesterday, and it seems code that was compiled by 6.5.0 is no longer compiling with 6.6.1
specifically, there are code sequences like the following:
function tr_CBSP_WRITE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr,
template BSSMAP_FIELD_CellIdentificationList cell_list,
template uint8_t channel_ind)
return template CBSP_PDU {
var template CBSP_IEs ies := {
tr_CbspMsgId(msg_id),
tr_NewSerNo(new_ser_nr)
};
if (istemplatekind(cell_list, "*")) {
ies[lengthof(ies)] := tr_CbspCellList ifpresent;
} else if (istemplatekind(cell_list, "?")) {
ies[lengthof(ies)] := tr_CbspCellList(?);
} else if (not istemplatekind(cell_list, "omit")) {
ies[lengthof(ies)] := tr_CbspCellList(cell_list);
}
if (not istemplatekind(channel_ind, "omit")) {
ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
}
return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
}
where 6.6.1 now fails compilation with:
CBSP_Templates.ttcn:371.25-39: error: `ifpresent' is not allowed here
The full source file is at https://git.osmocom.org/osmo-ttcn3-hacks/tree/library/CBSP_Templates.ttcn
unfortunately it gives no explanation as to why it's not allowed. The same code compiles just fine under earlier versions. I think up to 6.5.0 are fine. Right now I only have a system with 6.3.0 for testing, and 6.3.0 definitely compiles the same code just fine.
Can somebody help me clarify
a) if the above is a valid TTCN-3 language construct. If not, why?
b) was it intentional to remove this functionality from TITAN?
Thanks!
|
|
| | |
Re: more strict 'ifpresent' handling in titan 6.6.x compared to previous versions [message #1826255 is a reply to message #1826228] |
Wed, 22 April 2020 04:50  |
Eclipse User |
|
|
|
Hi Harald,
I don't think the template list will work at a set element level, but at the set level, like this:
if (istemplatekind(cell_list, "*")) {
var template CBSP_IEs ies0 := ies;
ies[lengthof(ies)] := tr_CbspCellList;
ies := (ies0, ies);
}
However, it has a consequence that no further ie-s can be added later. Therefore, the check and addition of channel_ind should be moved before the checking of cell_list.
function tr_CBSP_WRITE_CBS_COMPL(template integer msg_id, template integer new_ser_nr,
template BSSMAP_FIELD_CellIdentificationList cell_list,
template integer channel_ind)
return template CBSP_PDU {
var template CBSP_IEs ies := {
tr_CbspMsgId(msg_id),
tr_NewSerNo(new_ser_nr)
};
//GyRethy: this check is moved forward, in front of the cell_list check
if (not istemplatekind(channel_ind, "omit")) {
ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);
};
if (istemplatekind(cell_list, "*")) {
var template CBSP_IEs ies0 := ies;
ies[lengthof(ies)] := tr_CbspCellList;
ies := (ies0, ies);
} else if (istemplatekind(cell_list, "?")) {
ies[lengthof(ies)] := tr_CbspCellList(?);
} else if (not istemplatekind(cell_list, "omit")) {
ies[lengthof(ies)] := tr_CbspCellList(cell_list);
}
return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_COMPL, ies);
}
[Updated on: Wed, 22 April 2020 05:01] by Moderator
|
|
|
Goto Forum:
Current Time: Thu Jul 03 13:27:10 EDT 2025
Powered by FUDForum. Page generated in 0.03832 seconds
|