Skip to content

RAW decoder error: DTE during handling of out of range enum values

Summary

The RAW decoder of enumerated type can't handle large out of range values. If the decoded value is not fit to int, the decoder throws DTE instead of correct failure code

Steps and/or TTCN-3 code to reproduce

module proba{

type component CT {};

type enumerated my_enum{ a(0), b(1)} with {variant "FIELDLENGTH(32)"}

type union my_union{
  my_enum f1,
  octetstring f2
}

template my_union t_expected:={f2:='FFFFFFFF'O}

testcase t_1() runs on CT{
  var bitstring vl_encoded:='11111111111111111111111111111111'B
  var my_union vl_pdu
  var integer vl_res:=decvalue(vl_encoded,vl_pdu)
  
  log(vl_res)
  log(vl_pdu)
  if(vl_res == 0 and match(vl_pdu,t_expected)){
    setverdict(pass)
  } else {
    setverdict(fail)
  }
  
  
}

control{
  execute(t_1())
}
} with {encode "RAW"}

What is the current bug behavior?

Dynamic test case error: Invalid conversion of a large integer value

What is the expected correct behavior?

pass

Titan version

Up to 8.0.0

/cc @aknappqwt

Edited by Adam Knapp