Skip to content

Fully unitialized constants are allowed by Titan

Summary

According to Section 10 point d) of the TTCN-3 standard, "The right-hand side of the assignment that initializes a constant shall evaluate to an object that is at least partially initialized."

Steps and/or TTCN-3 code to reproduce

type record myRecord{
  integer field1,
  charstring field2 optional,
  integer field3
}

type record mymultirecord{
  myRecord A,
  myRecord B
}

type record of integer roi;

testcase partly_init_constants() runs on ct_empty{
  const mymultirecord cr := {A := {field1 := 1, field2 := -, field3 := -}, B := -};
  const mymultirecord ct := {A := -, B := -}; //should cause an error
  const roi iro := {}; //should cause an error
  setverdict(pass);
}

What is the current bug behavior?

The test case passes.

What is the expected correct behavior?

The indicated lines shall cause an error, as those constants are not even partially initialized (they have unbound fields).

Relevant logs and/or screenshots

Possible fixes

Titan version

8.1.0

Platform details (OS type and version)

Microsoft Windows 10 Enterprise 10.0.19042

/cc @aknappqwt @mmagyari