| | 424 | |
| | 425 | ==== There Must Be No Uninitialized Fields in Templates ==== |
| | 426 | * '''Symbolic Name in XML Configuration''': checkNoUninitializedFieldsInTemplates |
| | 427 | * '''Dependant Tags in XML Configuration''': - |
| | 428 | |
| | 429 | This 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). |
| | 430 | |
| | 431 | {{{ |
| | 432 | //manually defined types |
| | 433 | type record EventDefinitions { |
| | 434 | EventIds eventIds, |
| | 435 | integer fieldint, |
| | 436 | boolean fieldbool, |
| | 437 | integer fieldextmandat, |
| | 438 | integer fieldextopt optional, |
| | 439 | boolean fieldextboolopt optional |
| | 440 | } |
| | 441 | //this is probably a union? |
| | 442 | type record EventId { |
| | 443 | A1 eventA1 |
| | 444 | } |
| | 445 | type record A1 { |
| | 446 | boolean fieldeventA1 |
| | 447 | } |
| | 448 | type record of EventId EventIds |
| | 449 | |
| | 450 | template ( value ) EventDefinitions cs_EventDefinitions_eventA1_Errors ( |
| | 451 | boolean p_FieldeventA1 := true , |
| | 452 | integer p_Fieldint := 0 , |
| | 453 | boolean p_Fieldbool := true , //integer p_Fieldextmandat := 1, |
| | 454 | integer p_Fieldextopt := 2 |
| | 455 | /*, |
| | 456 | template (omit) boolean p_Fieldextboolopt := omit |
| | 457 | */ |
| | 458 | ) := { |
| | 459 | eventIds := { |
| | 460 | eventA1 := { |
| | 461 | fieldeventA1 := p_FieldeventA1 |
| | 462 | } |
| | 463 | |
| | 464 | }, |
| | 465 | fieldint := p_Fieldint , |
| | 466 | fieldbool := p_Fieldbool , |
| | 467 | //fielextmandat := p_Fieldextmandat, -> missing field in not seen by T3Q |
| | 468 | fieldextopt := p_Fieldextopt |
| | 469 | //fieldextboolopt := p_Fieldextboolopt -> missing field in not seen by T3Q |
| | 470 | } |
| | 471 | |
| | 472 | //correct version: should not raise warinings |
| | 473 | template ( value ) EventDefinitions cs_EventDefinitions_eventA1 ( |
| | 474 | boolean p_FieldeventA1 := true , |
| | 475 | integer p_Fieldint := 0 , |
| | 476 | boolean p_Fieldbool := true, |
| | 477 | integer p_Fieldextmandat := 1 , |
| | 478 | integer p_Fieldextopt := 2 , |
| | 479 | template ( omit ) boolean p_Fieldextboolopt := omit |
| | 480 | ) := { |
| | 481 | eventIds := { |
| | 482 | eventA1 := { |
| | 483 | fieldeventA1 := p_FieldeventA1 |
| | 484 | } |
| | 485 | |
| | 486 | }, |
| | 487 | fieldint := p_Fieldint , |
| | 488 | fieldbool := p_Fieldbool , |
| | 489 | fieldextmandat := p_Fieldextmandat , |
| | 490 | fieldextopt := p_Fieldextopt , |
| | 491 | fieldextboolopt := p_Fieldextboolopt |
| | 492 | } |
| | 493 | }}} |