// Master template // // // Declaring a structure variable when the structure definition is out of scope - 100 // Structure.Definition.Definition is not in scope // // // Same name is used for fields in more than one structure - 150 // Structure.Declaration.Conflict in the name of structure fields // // // Initialization of all the fields of a structure - 200 // Structure.Initialization.Complete // // Initialization of only some of the fields of a structure - 225 // Structure.Initialization.Incomplete? // // // Assignment to a field of a structure variable - 300 // Structure.Assignment.Field.Correct // // Assignment of a value of incorrect data type to a field of a structure variable - 325 // Structure.Assignment.Field.Value of incorrect data type assigned to variable // // Assigning to the field of a structure without using the dot operator - 350 // Structure.Assignment.Field.Referring to field independent of the variable // // Assigning from one structure variable to another in aggregate - 375 // Structure.Assignment.Aggregate // // Assigning to structure type instead of structure variable - 400 // Structure.Assignment.Assigning to structure type instead of structure variable // // // Correctly referencing the field of a structure variable - 500 // Structure.Referencing.Field.Correct // // Referencing the field of a structure variable before initializing it - 525 // Structure.Referencing.Field.Referencing variable before initializing its value // // Referencing a field that is not part of a structure variable - 550 // Structure.Referencing.Field.Referencing field that is not part of the structure // // Referencing the field of a structure variable without using the dot operator- 575 // // Same as Structure.Assignment.Field.Referring to field independent of the variable // // Structure.Referencing.Field.Missing dot operator in the statement // // // Testing that values assigned in caller propagate to the called function // // Structure variable passed as a parameter to a function where it is referenced - 600 // Structure.Parameter.Aggregate.Accessed // // Testing that changes in a function do not propagate back to caller // // Structure variable passed as a parameter to a function where it is modified - 625 // Structure.Parameter.Aggregate.Modified // // Field of a structure variable passed as a parameter to a function - 650 // Structure.Parameter.Field // // // One is a structure, other a variable corresponding to one of its fields - 675 // Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition // // // Entire structure is returned by a function - 700 // Structure.Returned // // // Declaring variable of nested structure - 800 // Structure.Nested.Declaring variable of nested structure // // Assigning to nested field - 825 // Structure.Nested.Assigning to nested field // // Referencing nested field - 850 // Structure.Nested.Referencing nested field // // // ================================================================================= // // Declaring a structure variable when the structure definition is out of scope - 100 // Structure.Definition.Definition is not in scope # 100 Structure.Definition.Definition is not in scope > { (){ { ; ; }; ; >> .; } (){ (); ; >> .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 101 Structure.Definition.Definition is not in scope > { (){ ; >> .; } (){ { ; ; }; (); ; >> .; >> .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 102 Structure.Definition.Definition is not in scope > { (){ >> .; } (){ { ; ; }; ; (); >> .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Same name is used for fields in more than one structure - 150 // Structure.Declaration.Conflict in the name of structure fields # 150 Structure.Declaration.Conflict in the name of structure fields > { (){ { ; ; }; { ; ; }; ; >> .; ; >> .; << .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 151 Structure.Declaration.Conflict in the name of structure fields > { (){ { ; ; }; { ; ; }; ; . = ; ; >> .; = . - .; << ; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 152 Structure.Declaration.Conflict in the name of structure fields > { (){ { ; ; }; { ; ; }; ; . = ; ; . = ; << .; << .; }} > Type: debug_output Hardness: 10 # 153 Structure.Declaration.Conflict in the name of structure fields > { (){ { ; ; }; { ; ; }; ; >> .; ; . = ; << . - .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Initialization of all the fields of a structure - 200 // Structure.Initialization.Complete # 200 Structure.Initialization.Complete ? Structure.Referencing.Field.Correct > { (){ { ; ; ; }; = { , , true }; << . - .; }} > Type: debug_output Hardness: 10 # 201 Structure.Initialization.Complete ? Structure.Referencing.Field.Correct > { (){ { ; ; ; }; = { , , }; << . * 10; }} > Type: debug_output Hardness: 10 # 202 Structure.Initialization.Complete ? Structure.Referencing.Field.Correct > { (){ { ; ; ; }; = { , , true }; << . + 10; }} > Type: debug_output Hardness: 10 # 203 Structure.Initialization.Complete ? Structure.Referencing.Field.Correct > { (){ { ; ; ; }; = { , false, }; << .; }} > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // TO DO - CHECK WHAT HAPPENS IN REAL CODE // // Initialization of only some of the fields of a structure - 225 // Structure.Initialization.Incomplete # 225 Structure.Initialization.Incomplete > { (){ { ; ; ; }; = { }; << .; }} > Type: debug_output Hardness: 10 # 226 Structure.Initialization.Incomplete > { (){ { ; ; ; }; = { , }; << . + 1; }} > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Assignment to a field of a structure variable - 300 // Structure.Assignment.Field.Correct # 300 Structure.Assignment.Field.Correct ? Structure.Referencing.Field.Correct > { (){ { ; ; }; ; . = ; >> .; << . - .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 301 Structure.Assignment.Field.Correct ? Structure.Referencing.Field.Correct > { (){ { ; ; }; ; >> .; . = ; << . - .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 302 Structure.Assignment.Field.Correct ? Structure.Referencing.Field.Correct > { (){ { ; ; }; ; . = ; << .; . = ; << .; }} > Type: debug_output Hardness: 10 // Two inputs - will it be a problem? - may be not since inputs are back to back # 303 Structure.Assignment.Field.Correct ? Structure.Referencing.Field.Correct > { (){ { ; ; }; ; >> .; >> .; << .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Assignment of a value of incorrect data type to a field of a structure variable - 325 // Structure.Assignment.Field.Value of incorrect data type assigned to variable # 325 Structure.Assignment.Field.Value of incorrect data type assigned to variable > { (){ { ; ; }; ; = ; . = ; << * 10; }} > Type: debug_output Hardness: 10 # 326 Structure.Assignment.Field.Value of incorrect data type assigned to variable > { (){ { ; ; }; = ; ; . = ; << + 10; }} > Type: debug_output Hardness: 10 # 327 Structure.Assignment.Field.Value of incorrect data type assigned to variable > { (){ { ; ; }; ; ; >> ; . = ; << ; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Assigning to the field of a structure without using the dot operator - 350 // Structure.Assignment.Field.Referring to field independent of the variable # 350 Structure.Assignment.Field.Referring to field as independent variable > { (){ { ; ; }; = ; = ; << ; }} > Type: debug_output Hardness: 10 # 351 Structure.Assignment.Field.Referring to field as independent variable > { (){ { ; ; }; ; >> ; >> ; << ; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 352 Structure.Assignment.Field.Referring to field as independent variable > { (){ { ; ; }; = ; ; >> ; << ; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 353 Structure.Assignment.Field.Referring to field as independent variable > { (){ { ; ; }; ; ; >> ; = ; << ; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Assigning from one structure variable to another in aggregate - 375 // Structure.Assignment.Aggregate # 375 Structure.Assignment.Aggregate ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { (){ { ; ; }; ; . = ; . = ; ; = ; << . - .; }} > Type: debug_output Hardness: 10 // Two inputs - will it be a problem? - may be not since inputs are back to back # 376 Structure.Assignment.Aggregate ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { (){ { ; ; }; ; >> .; >> .; ; = ; << . - .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Assigning to structure type instead of structure variable - 400 // Structure.Assignment.Assigning to structure type instead of structure variable # 400 Structure.Assignment.Assigning to structure type instead of structure variable > { (){ { ; ; }; . = ; ; = * ; << ; }} > Type: debug_output Hardness: 10 # 401 Structure.Assignment.Assigning to structure type instead of structure variable > { (){ { ; ; }; >> .; ; >> ; << * 10; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 402 Structure.Assignment.Assigning to structure type instead of structure variable > { (){ { ; ; }; = ; >> .; << ; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 403 Structure.Assignment.Assigning to structure type instead of structure variable > { (){ { ; ; }; ; >> ; . = ; << ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Correctly referencing the field of a structure variable - 500 // Structure.Referencing.Field.Correct # 500 Structure.Referencing.Field.Correct ? Structure.Assignment.Field.Correct > { (){ { ; ; ; }; ; . = ; >> .; = . - .; << ; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 501 Structure.Referencing.Field.Correct ? Structure.Assignment.Field.Correct > { (){ { ; ; ; }; ; >> .; . = ; << . + .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // Two inputs - will it be a problem? - may be not since inputs are back to back # 502 Structure.Referencing.Field.Correct ? Structure.Assignment.Field.Correct > { (){ { ; ; ; }; ; >> .; >> .; << .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 503 Structure.Referencing.Field.Correct ? Structure.Assignment.Field.Correct > { (){ { ; ; ; }; ; . = ; << .; . = ; << .; }} > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Referencing the field of a structure variable before initializing it - 525 // Structure.Referencing.Field.Referencing variable before initializing its value # 525 Structure.Referencing.Field.Referencing variable before initializing its value > { (){ { ; ; }; ; . = ; << .; }} > Type: debug_output Hardness: 10 # 526 Structure.Referencing.Field.Referencing variable before initializing its value > { (){ { ; ; }; ; . = true; << .; }} > Type: debug_output Hardness: 10 # 527 Structure.Referencing.Field.Referencing variable before initializing its value > { (){ { ; ; }; ; >> .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 528 Structure.Referencing.Field.Referencing variable before initializing its value > { (){ { ; ; }; ; >> .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Referencing a field that is not part of a structure variable - 550 // Structure.Referencing.Field.Referencing field that is not part of the structure # 550 Structure.Referencing.Field.Referencing field that is not part of the structure > { (){ { ; ; ; }; ; . = ; >> .; . = ; << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 551 Structure.Referencing.Field.Referencing field that is not part of the structure > { (){ { ; ; ; }; ; >> .; . = ; . = ; << . - .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 552 Structure.Referencing.Field.Referencing field that is not part of the structure > { (){ { ; ; ; }; ; >> .; >> .; . = ; << . * .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 553 Structure.Referencing.Field.Referencing field that is not part of the structure > { (){ { ; ; ; }; ; . = ; << .; . = ; . = false; << .; }} > Type: debug_output Hardness: 10 # 554 Structure.Referencing.Field.Referencing field that is not part of the structure > { (){ { ; ; ; }; ; >> .; << . * .; = ; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 555 Structure.Referencing.Field.Referencing field that is not part of the structure > { (){ { ; ; ; }; ; . = ; << . * 2; = false; << .; }} > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // Testing that values of a caller propagate to a function // // Structure variable passed as a parameter to a function where it is referenced - 600 // Structure.Parameter.Aggregate.Accessed # 600 Structure.Parameter.Aggregate.Accessed ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ << . + 10; } (){ ; >> .; (); << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 601 Structure.Parameter.Aggregate.Accessed ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ << .; } (){ ; . = ; (); << .; }} > Type: debug_output Hardness: 10 # 602 Structure.Parameter.Aggregate.Accessed ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ << . + 1; } (){ ; >> .; << .; (); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 603 Structure.Parameter.Aggregate.Accessed ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ << . * 10; } (){ ; . = ; << .; (); }} > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // Testing that changes in a function do not propagate back to caller // // Structure variable passed as a parameter to a function where it is modified - 625 // Structure.Parameter.Aggregate.Modified # 625 Structure.Parameter.Aggregate.Modified ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ . = ; << .; } (){ ; >> .; (); << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 626 Structure.Parameter.Aggregate.Modified ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ . = ; << .; } (){ ; . = ; (); << .; }} > Type: debug_output Hardness: 10 # 627 Structure.Parameter.Aggregate.Modified ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ . = ; << .; } (){ ; >> .; (); << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 628 Structure.Parameter.Aggregate.Modified ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ >> .; << .; } (){ ; . = ; (); << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Field of a structure variable passed as a parameter to a function - 650 // Structure.Parameter.Field # 650 Structure.Parameter.Field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { (){ << + 10; = ; << + 10; } (){ { ; ; }; ; >> .; (.); << . + 10; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 651 Structure.Parameter.Field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { (){ << ; = ; << ; } (){ { ; ; }; ; . = ; (.); << .; }} > Type: debug_output Hardness: 10 # 652 Structure.Parameter.Field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { (){ << ; >> ; << ; } (){ { ; ; }; ; . = ; . = ; (.); << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 653 Structure.Parameter.Field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { (){ << * 10; = ; << * 10; } (){ { ; ; }; ; . = ; . = false; (.); << . * 10; }} > Type: debug_output Hardness: 10 # 655 Structure.Parameter.Field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { (,){ << + 1; = ; >> ; << - 1; } (){ { ; ; }; ; . = ; >> .; (.,.); << .; << .; }} > Input: "\n\n" > Type: debug_output Hardness: 20 # 656 Structure.Parameter.Field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { (,){ << ; >> ; = ; << * 10; } (){ { ; ; }; ; . = ; . = ; (.,.); << .; << .; }} > Input: "\n" > Type: debug_output Hardness: 20 // // --------------------------------------------------------------------------------- // // One is a structure, other a variable corresponding to one of its fields - 675 // Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition # 675 Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > { (){ << + 10; = ; << + 10; } (){ { ; ; }; ; >> .; (); << . + 10; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 676 Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > { { ; ; }; (){ . = ; << .; } (){ ; >> .; (.); << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 677 Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > { (){ << ; = ; << ; } (){ { ; ; }; ; . = ; (); << .; }} > Type: debug_output Hardness: 10 # 678 Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > { { ; ; }; (){ . = ; << .; } (){ ; . = ; (.); << .; }} > Type: debug_output Hardness: 10 # 679 Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > { (){ << ; >> ; << ; } (){ { ; ; }; ; >> .; . = ; (); << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 680 Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > { { ; ; }; (){ . = ; << .; } (){ ; >> .; (.); << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 681 Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > { (){ << * 10; = ; << * 10; } (){ { ; ; }; ; . = ; . = false; (); << . * 10; }} > Type: debug_output Hardness: 10 # 682 Structure.Parameter.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > { { ; ; }; (){ >> .; << .; } (){ ; . = ; (.); << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Entire structure is returned by a function - 700 // Structure.Returned # 700 Structure.Returned ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ ; >> .; >> .; return ; } (){ = (); << .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 701 Structure.Returned ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; }; (){ ; . = ; . = ; return ; } (){ = (); << .; << .; }} > Type: debug_output Hardness: 10 # 702 Structure.Returned ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; ; }; (){ ; >> .; . = ; . = ; return ; } (){ = (); << .; << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 703 Structure.Returned ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct} > { { ; ; ; }; (){ ; . = ; . = true; >> .; return ; } (){ = (); << .; << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Declaring variable of nested structure - 800 // Structure.Nested.Declaring variable of nested structure # 800 Structure.Nested.Declaring variable of nested structure > { { ; ; { ; ; } ; }; (){ ; >> .; ; << . * 2; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 801 Structure.Nested.Declaring variable of nested structure > { { ; ; { ; ; } ; }; (){ ; ; >> .; << . * 10; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 802 Structure.Nested.Declaring variable of nested structure > { { ; { ; ; } ; ; }; (){ ; >> .; ; >> .; << . - .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 803 Structure.Nested.Declaring variable of nested structure > { { ; { ; ; } ; ; }; (){ ; ; >> .; << .; >> .; << .; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Assigning to nested field - 825 // Structure.Nested.Assigning to nested field # 825 Structure.Nested.Assigning to nested field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct,Nested.Referencing nested field} > { { ; ; { ; ; } ; }; (){ ; >> ..; >> .; << .. * 2; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 826 Structure.Nested.Assigning to nested field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct,Nested.Referencing nested field} > { { ; ; { ; ; } ; }; (){ ; >> ..; >> .; << .. + 1; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 827 Structure.Nested.Assigning to nested field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct,Nested.Referencing nested field} > { { ; { ; ; } ; ; }; (){ ; >> ..; . = true; . = ; << .. * 10; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 828 Structure.Nested.Assigning to nested field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct,Nested.Referencing nested field} > { { ; { ; ; } ; ; }; (){ ; >> ..; . = ; << ..; . = ; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // // --------------------------------------------------------------------------------- // // Referencing nested field - 850 // Structure.Nested.Referencing nested field # 850 Structure.Nested.Referencing to nested field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct,Nested.Assigning to nested field} > { { ; ; { ; ; } ; }; (){ ; . = ; .. = ; . = ; << .. - 5; }} > Type: debug_output Hardness: 10 # 851 Structure.Nested.Referencing to nested field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct,Nested.Assigning to nested field} > { { ; { ; ; } ; ; }; (){ ; .. = ; . = ; . = false; << .. * 2; >> ..; }} > Input: "\n" > Type: debug_output Hardness: 10 # 852 Structure.Nested.Referencing to nested field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct,Nested.Assigning to nested field} > { { ; { ; ; } ; ; }; (){ ; .. = ; . = true; >> .; << ..; >> .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 853 Structure.Nested.Referencing to nested field ? Structure.{Assignment.Field.Correct,Referencing.Field.Correct,Nested.Assigning to nested field} > { { ; ; { ; ; } ; }; (){ ; >> ..; >> .; . = false; >> .; << .. + 1; .. = ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // // ---------------------------------------------------------------------------------