Skip to content

Rotate does not work well on partly initialized record ofs, set ofs, and arrays

Summary

According to Section 7.1.7 of the TTCN-3 standard, "When the rotate operator is used for record of-s, set of-s and arrays, its left hand operand shall be at least partially initialized." However, it does not work, only with fully initialized data elements.

Steps and/or TTCN-3 code to reproduce

type record of integer ROI;
type set of integer SOI;

testcase rotatopsub() runs on ct_empty{
  var integer uiarray[3], rot_uiarray[3];
  uiarray[0] := 1;
  uiarray[2] := 3;
  var ROI uiro, rot_uiro;
  uiro[0] := 1;
  uiro[2] := 3;
  var SOI uiso, rot_uiso;
  uiso[0] := 1;
  uiso[2] := 3;
  rot_uiarray := uiarray @> 2;
  rot_uiro := uiro @> 2;
  rot_uiso := uiso @> 2;
/*  if(rot_uiarray[0].isbound){setverdict(pass);}else{setverdict(fail);}
  if(rot_uiro[0].isbound){setverdict(pass);}else{setverdict(fail);}
  if(rot_uiso[0].isbound){setverdict(pass);}else{setverdict(fail);}
*/
}

What is the current bug behavior?

Runtime error, and after uncommenting the last 3 rows, compile error.

What is the expected correct behavior?

Pass.

Relevant logs and/or screenshots

MTC@HUL21014: Dynamic test case error: Assignment of an unbound integer value.

Possible fixes

Titan version

8.1.0

Platform details (OS type and version)

Microsoft Windows 10 Enterprise 10.0.19042

/cc @aknappqwt @mmagyari