|
6.2.1.1 Referencing fields of a record type |
Add test |
|
6.2.1.1 Referencing fields of a record type
|
ElementId shall resolve to the name of a field in the structured type |
Add test |
|
|
ElementId shall resolve to the name of a field in the structured type
|
|
Elements of a record shall be referenced by the dot notation TypeIdOrExpression.ElementId |
Add test |
|
|
Elements of a record shall be referenced by the dot notation TypeIdOrExpression.ElementId, where TypeIdOrExpression resolves to the name of a structured type or an expression of a structured type such as variable, formal parameter, module parameter, constant, template, or function invocation
|
|
Fields of record type definitions shall not reference themselves. |
Add test |
|
Fields of record type definitions shall not reference themselves.
|
|
the resulting type is the set of values allowed for that field imposed by the constraints of the field declaration itself |
Add test |
|
|
If a field in a record type or a subtype of a record type is referenced by the dot notation, the resulting type is the set of values allowed for that field imposed by the constraints of the field declaration itself (i.e. any constraints applied to the record type itself are ignored).
|
|
|
6.2.1.2 Optional elements in a record |
Add test |
|
6.2.1.2 Optional elements in a record
|
Optional elements in a record shall be specified using the optional keyword. |
Add test |
|
|
Optional elements in a record shall be specified using the optional keyword.
|
|
Optional fields shall be omitted using the omit symbol. |
Add test |
|
|
Optional fields shall be omitted using the omit symbol.
|
|
|
6.2.1.3 Nested type definitions for field types |
Add test |
|
6.2.1.3 Nested type definitions for field types
|
definition of types for record fields nested within the record definition |
Add test |
|
TTCN3 supports the definition of types for record fields nested within the record definition. Both the definition of new structured types (record, set, enumerated, set of, record of, and union) and the specification of subtype constraints are possible.
|
|
|
Records may be defined with no fields, i.e. as empty records. |
Add test |
|
Records may be defined with no fields, i.e. as empty records.
|
|
The element identifiers are local to the record and do not have to be globally unique |
Add test |
|
|
but do not have to be globally unique
|
|
The element identifiers are local to the record and shall be unique within the record |
Add test |
|
The element identifiers are local to the record and shall be unique within the record
|
|
The omit keyword shall only be used for optional fields |
Add test |
|
|
The omit keyword shall only be used for optional fields
|
|
The order of field values in the value list notation shall be the same as the order of fields in the related type definition |
Add test |
|
|
The order of field values in the value list notation shall be the same as the order of fields in the related type definition
|
|
The values of a record shall be compatible with the types of the record fields |
Add test |
|
The values of a record shall be compatible with the types of the record fields
|
|
When the assignment notation is used in a scope, where the optional attribute is set to "implicit omit" |
Add test |
|
When the assignment notation is used in a scope, where the optional attribute is set to "implicit omit"
|
optional fields, not directly referred to in the notation, shall implicitly be set to omit |
Add test |
|
|
optional fields, not directly referred to in the notation, shall implicitly be set to omit
|
|
while mandatory fields shall remain unchanged (see also clause 27.7). |
Add test |
|
|
while mandatory fields shall remain unchanged (see also clause 27.7).
|
|
|
When the value list notation is used with the optional attribute is implicitly or explicitly set to "explicit omit, |
Add test |
|
When the value list notation is used in a scope, where the optional attribute is implicitly or explicitly set to "explicit omit,
|
In this way, a value with initialized fields or elements can be made empty by using an empty pair of curly brackets ("{}"). |
Add test |
|
In this way, a value with initialized fields or elements can be made empty by using an empty pair of curly brackets ("{}").
|
|
already initialized fields or elements left without an associated component are becoming uninitialized |
Add test |
|
already initialized fields or elements left without an associated component in a value list notation (i.e. at the end of a value ) are becoming uninitialized
|
|
|
When using the value list notation |
Add test |
|
When using the value list notation
|
Fields or elements to be left unchanged shall be explicitly skipped in the list by using the not-used-symbol "-". |
Add test |
|
Fields or elements to be left unchanged shall be explicitly skipped in the list by using the not-used-symbol "-".
|
|
No empty assignment is allowed |
Add test |
|
No empty assignment is allowed (i.e. two commas, the second immediately following the first or only with white space between them)
|
|
The omit keyword shall only be used for optional fields |
Add test |
|
|
The omit keyword shall only be used for optional fields
|
|
all fields in the structure shall be specified either with a value, the not used symbol "" or the omit keyword |
Add test |
|
all fields in the structure shall be specified either with a value, the not used symbol "" or the omit keyword
|
|
components assosiations |
Add test |
|
|
The first component of the list (a value, a "-" or omit) is associated with the first field, the second list component is associated with the second field etc
|
|
|
When using value list notation in a scope where the optional attribute is set to "implicit omit" |
Add test |
|
When using value list notation in a scope where the optional attribute is set to "implicit omit"
|
fields wished to be omitted by the implicit mechanism, either the not used symbol "-" can be used for some or all of them |
Add test |
|
|
When all remaining fields at the end of the type definition are optional and they are wished to be omitted by the implicit mechanism, either the not used symbol "-" can be used for some or all of them
|
|
optional fields wished to be omitted by the implicit mechanism shall be skipped by using the not used symbol "-" |
Add test |
|
|
optional fields wished to be omitted by the implicit mechanism, but followed by fields to which a value or template is assigned explicitly, shall be skipped by using the not used symbol "-"
|
|
or they can simply be left out from the notation. |
Add test |
|
|
or they can simply be left out from the notation.
|
|
|
fields wished to be changed shall be identified explicitly |
Add test |
|
|
When the assignment notation is used for records, fields wished to be changed shall be identified explicitly and a value, the not used symbol "-" or the omit keyword can be associated with them.
|
|
record is an ordered structured types |
Add test |
|
|
|
|
the assignment notation is used in a scope, where the optional attribute is implicitly or explicitly set to "explicit omit" |
Add test |
|
the assignment notation is used in a scope, where the optional attribute is implicitly or explicitly set to "explicit omit"
|
Fields or elements not mentioned are implicitly left uninitialized |
Add test |
|
Fields or elements not mentioned are implicitly left uninitialized
|
|
It is also possible to leave fields explicitly unspecified using the not used symbol "-" |
Add test |
|
It is also possible to leave fields explicitly unspecified using the not used symbol "-"
|
|
When re-assigning a previously initialized value will cause that field or element to remain unchanged. |
Add test |
|
When re-assigning a previously initialized value, using the not used symbol or just skipping a field or element in an assignment notation, will cause that field or element to remain unchanged.
|
|
fields, not explicitly referred to in the notation, shall remain unchanged |
Add test |
|
fields, not explicitly referred to in the notation, shall remain unchanged
|
|
only the fields or elements to be assigned values shall be specified |
Add test |
|
In particular, when specifying partial values (i.e. setting the value of only a subset of the fields) using the assignment notation, for example, at initialization, only the fields or elements to be assigned values shall be specified
|
|