Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » compiler: Support of ABSENT and PRESENT PresenceConstraints(Does the ABSENT and PRESENT PresenceConstraints are supported by ASN1 compiler?)
compiler: Support of ABSENT and PRESENT PresenceConstraints [message #1794029] Wed, 22 August 2018 16:26 Go to next message
Viktor Tarasov is currently offline Viktor TarasovFriend
Messages: 8
Registered: August 2018
Junior Member
Hi,

I'm trying to create test cases for the ETSI-TS-103-097 ASN1 module,
where the ABSENT and PRESENT PresenceConstraints are massively used.

It seems that these constraints are not currently supported by the core compiler. Is it really so?

Here are the test case script that I've used:
...
BEGIN
  IMPORTS;
  BaseChoice ::= CHOICE { ii INTEGER (0..255), os OCTET STRING (SIZE (2)) }
  MyChoice ::= BaseChoice (WITH COMPONENTS {..., ii ABSENT})
END
...
external function enc_OER_MyChoice(in MyChoice pdu) return octetstring with { extension "prototype(convert) encode(OER)" }
...
testcase tc_OER_MyChoice() runs on Test_CT {
  const MyChoice mc01 := {ii:=45}, mc02 := {os:='7777'O};
  
  if (enc_OER_MyChoice(mc01) == '00'O) {setverdict(pass);} else {setverdict(fail);}
  if (enc_OER_MyChoice(mc02) == '00'O) {setverdict(pass);} else {setverdict(fail);}
}


Here I expect the compile or runtime error when initializing MyChoice variable with the 'absent' choice.


Kind regards,
Victor.
Re: compiler: Support of ABSENT and PRESENT PresenceConstraints [message #1794268 is a reply to message #1794029] Tue, 28 August 2018 11:01 Go to previous message
Kristof Szabados is currently offline Kristof SzabadosFriend
Messages: 32
Registered: July 2015
Member
Hi Viktor,

Thank you for checking this issue, and creating a small example.

You are right constraints are not fully supported in Titan for now.
The restriction itself is checked, but not checked on values.

for example: If you change ii ABSENT to i2 ABSENT, Titan will notice that you are refering to a non-existent field. But as you noticed when checking the mc01 the type restriction of MyChoice is not checked.
Previous Topic:Decoding NAS PDUs
Next Topic:Problems in LibItsBtp_EncdecDeclarations.hh
Goto Forum:
  


Current Time: Mon Nov 19 05:47:00 GMT 2018

Powered by FUDForum. Page generated in 0.01439 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top