Changes between Version 19 and Version 20 of Documentation/T3Q/Quality-Checks/Code-Style


Ignore:
Timestamp:
10/14/25 16:39:17 (5 months ago)
Author:
phdmakk
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/T3Q/Quality-Checks/Code-Style

    v19 v20  
    425425==== There Must Be No Uninitialized Fields in Templates ==== 
    426426 * '''Symbolic Name in XML Configuration''': checkNoUninitializedFieldsInTemplates 
    427  * '''Dependant Tags in XML Configuration''': - 
     427 * '''Dependant Tags in XML Configuration''': checkNoUninitializedFieldsInTemplatesRecursion 
    428428 
    429429This check makes sure there are no uninitialized fields in templates. This currently covers declared templates (on the module level only) for structured types declared in TTCN-3 (support for structured types declared in ASN.1 is currently being investigated). 
     
    492492        } 
    493493}}} 
     494 
     495By default only the first level of modified templates is checked in case a template modifies another template, and the field specifications in the base template are considered. With the option '''checkNoUnititializedFieldsInTemplatesRecursion''' multiple levels of modified templates are considered. 
     496 
     497{{{ 
     498module checkNoUnititializedFieldsInTemplatesRecursion { 
     499    type record R { 
     500        integer f1,  
     501        integer f2, 
     502        integer f3 
     503    } 
     504 
     505    template R A := {f1 := 1} //base template, not fully-specified -> warning 
     506 
     507    template R B1 modifies A := {f2 := 2, f3:= 3} //fully-specified, inherits f1 -> no warning 
     508 
     509    template R B2 modifies A := {f2 := 2} //not fully-specified, inherits f1, misses f3 -> warning 
     510 
     511    template R C1 modifies B1 := {f1 := 3} //fully-specified, inherits f2, f3 -> no warning 
     512 
     513    template R C2 modifies B2 := {f3 := 3} //fully-specified, inherits f1 from A, f2 from B2  
     514    //-> no warning if checkNoUnititializedFieldsInTemplatesRecursion is true 
     515    //-> warning if checkNoUnititializedFieldsInTemplatesRecursion is false (only f2 from B2 considered) 
     516}  
     517}}} 
     518