Loading ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_001.ttcn 0 → 100644 +28 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that in template formal parameters of template cannot used dash as default value ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Formal template parameters of modified templates may inherit their default templates from the // corresponding parameters of their parent templates; this shall explicitly be denoted by using // a dash (don't change) symbol at the place of the modified template parameter's default template. module NegSem_05040102_parameters_of_kind_template_001 { type component GeneralComp { } type record R { integer field1, integer field2 } template R mw_t(template integer p_int1 := ?, in template integer p_int2 := -) := { field1 := p_int1, field2 := p_int2 } } ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_002.ttcn 0 → 100644 +33 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that modified template cannot used dash as default value when original template parameter had no default value ** @verdict pass accept, noexecution ***************************************************/ // The following requirement is tested: // Formal template parameters of modified templates may inherit their default templates from the // corresponding parameters of their parent templates; this shall explicitly be denoted by using // a dash (don't change) symbol at the place of the modified template parameter's default template. module NegSem_05040102_parameters_of_kind_template_002 { type component GeneralComp { } type record R { integer field1, integer field2 } template R m_t(template integer p_int1, in template integer p_int2 := 4) := { field1 := p_int1, field2 := p_int2 } template R m_tmod(template integer p_int1 := -, in template integer p_int2 := ?) modifies m_t := { field1 := p_int1, field2 := p_int2 } } ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_003.ttcn 0 → 100644 +41 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that template definitions cannot contain out template formal parameters ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction b) // Formal template parameters of templates ... shall always be in parameters. module NegSem_05040101_parameters_of_kind_template_003 { type component GeneralComp { } type record R { integer field1, integer field2 } function f(out template integer p_int) return template integer { p_int := ?; return p_int; } template R m_t(out template integer p_int) := { field1 := 0, field2 := f(p_int) } testcase TC_NegSem_05040101_parameters_of_kind_template_003() runs on GeneralComp { var template integer v_int; log(m_t(v_int)); setverdict(pass); } control{ execute(TC_NegSem_05040101_parameters_of_kind_template_003()); } } ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn 0 → 100644 +41 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that template definitions cannot contain inout template formal parameters ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction b) // Formal value parameters of templates ... shall always be in parameters. module NegSem_05040102_parameters_of_kind_template_004 { type component GeneralComp { } type record R { integer field1, integer field2 } function f(inout template integer p_int) return template integer { p_int := ?; return p_int; } template R m_t(inout template integer p_int) := { field1 := 0, field2 := f(p_int) } testcase TC_NegSem_05040102_parameters_of_kind_template_004() runs on GeneralComp { var template integer v_int := 1; log(m_t(v_int)); setverdict(pass); } control{ execute(TC_NegSem_05040102_parameters_of_kind_template_004()); } } ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_005.ttcn 0 → 100644 +29 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that out template formal parameters cannot have default values ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction c) // Default templates can be provided for in parameters only. module NegSem_05040102_parameters_of_kind_template_005 { type component GeneralComp { } function f(out template integer p_int := ?) { } testcase TC_NegSem_05040102_parameters_of_kind_template_005() runs on GeneralComp { var template integer v_int; f(v_int); log(v_int); setverdict(pass); } control{ execute(TC_NegSem_05040102_parameters_of_kind_template_005()); } } Loading
ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_001.ttcn 0 → 100644 +28 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that in template formal parameters of template cannot used dash as default value ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Formal template parameters of modified templates may inherit their default templates from the // corresponding parameters of their parent templates; this shall explicitly be denoted by using // a dash (don't change) symbol at the place of the modified template parameter's default template. module NegSem_05040102_parameters_of_kind_template_001 { type component GeneralComp { } type record R { integer field1, integer field2 } template R mw_t(template integer p_int1 := ?, in template integer p_int2 := -) := { field1 := p_int1, field2 := p_int2 } }
ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_002.ttcn 0 → 100644 +33 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that modified template cannot used dash as default value when original template parameter had no default value ** @verdict pass accept, noexecution ***************************************************/ // The following requirement is tested: // Formal template parameters of modified templates may inherit their default templates from the // corresponding parameters of their parent templates; this shall explicitly be denoted by using // a dash (don't change) symbol at the place of the modified template parameter's default template. module NegSem_05040102_parameters_of_kind_template_002 { type component GeneralComp { } type record R { integer field1, integer field2 } template R m_t(template integer p_int1, in template integer p_int2 := 4) := { field1 := p_int1, field2 := p_int2 } template R m_tmod(template integer p_int1 := -, in template integer p_int2 := ?) modifies m_t := { field1 := p_int1, field2 := p_int2 } }
ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_003.ttcn 0 → 100644 +41 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that template definitions cannot contain out template formal parameters ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction b) // Formal template parameters of templates ... shall always be in parameters. module NegSem_05040101_parameters_of_kind_template_003 { type component GeneralComp { } type record R { integer field1, integer field2 } function f(out template integer p_int) return template integer { p_int := ?; return p_int; } template R m_t(out template integer p_int) := { field1 := 0, field2 := f(p_int) } testcase TC_NegSem_05040101_parameters_of_kind_template_003() runs on GeneralComp { var template integer v_int; log(m_t(v_int)); setverdict(pass); } control{ execute(TC_NegSem_05040101_parameters_of_kind_template_003()); } }
ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn 0 → 100644 +41 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that template definitions cannot contain inout template formal parameters ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction b) // Formal value parameters of templates ... shall always be in parameters. module NegSem_05040102_parameters_of_kind_template_004 { type component GeneralComp { } type record R { integer field1, integer field2 } function f(inout template integer p_int) return template integer { p_int := ?; return p_int; } template R m_t(inout template integer p_int) := { field1 := 0, field2 := f(p_int) } testcase TC_NegSem_05040102_parameters_of_kind_template_004() runs on GeneralComp { var template integer v_int := 1; log(m_t(v_int)); setverdict(pass); } control{ execute(TC_NegSem_05040102_parameters_of_kind_template_004()); } }
ATS/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_005.ttcn 0 → 100644 +29 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.2, verify that out template formal parameters cannot have default values ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction c) // Default templates can be provided for in parameters only. module NegSem_05040102_parameters_of_kind_template_005 { type component GeneralComp { } function f(out template integer p_int := ?) { } testcase TC_NegSem_05040102_parameters_of_kind_template_005() runs on GeneralComp { var template integer v_int; f(v_int); log(v_int); setverdict(pass); } control{ execute(TC_NegSem_05040102_parameters_of_kind_template_005()); } }