Loading 15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_001.ttcn 0 → 100644 +25 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation rejects valueof with non-concrete values, in this case omit. ** @verdict pass reject *****************************************************************/ module NegSem_1510_ValueOfOperation_001 { type component GeneralComp { } testcase TC_NegSem_1510_ValueOfOperation_001() runs on GeneralComp { var template integer m_int := omit; var integer v_int := valueof(m_int); // if we get here, something must be wrong as valueof on m_int shall cause an error // due to the omit. setverdict(fail); } control{ execute(TC_NegSem_1510_ValueOfOperation_001()); } } No newline at end of file 15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_002.ttcn 0 → 100644 +34 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation rejects valueof with non-concrete values, in this case omit. ** @verdict pass reject *****************************************************************/ module NegSem_1510_ValueOfOperation_002 { type component GeneralComp { } type record ExampleType { integer field1, boolean field2 } template ExampleType m_template := { field1 := *, field2 := ? } testcase TC_NegSem_1510_ValueOfOperation_002() runs on GeneralComp { var ExampleType v_int := valueof(m_template); // if we get here, something must be wrong as valueof on m_template shall cause an error // due to the * and ? wildcards. setverdict(fail); } control{ execute(TC_NegSem_1510_ValueOfOperation_002()); } } No newline at end of file 15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_003.ttcn 0 → 100644 +34 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation rejects non-templates, in this case a structured type. ** @verdict pass reject *****************************************************************/ module NegSem_1510_ValueOfOperation_003 { type component GeneralComp { } type record ExampleType { integer field1, boolean field2 } testcase TC_NegSem_1510_ValueOfOperation_003() runs on GeneralComp { var ExampleType f_first := { field1 := 2, field2 := true }; var ExampleType v_second := valueof(f_first); // if we get here, something must be wrong as valueof on m_template shall cause an error // as it is a value and not a template. setverdict(fail); } control{ execute(TC_NegSem_1510_ValueOfOperation_003()); } } No newline at end of file 15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_004.ttcn 0 → 100644 +26 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation rejects non-templates, in this case a basic type integer. ** @verdict pass reject *****************************************************************/ module NegSem_1510_ValueOfOperation_004 { type component GeneralComp { } testcase TC_NegSem_1510_ValueOfOperation_004() runs on GeneralComp { var integer v_test := 2; var integer v_second := valueof(v_test); // if we get here, something must be wrong as valueof on v_test shall cause an error // as it is not a template. setverdict(fail); } control{ execute(TC_NegSem_1510_ValueOfOperation_004()); } } No newline at end of file 15_templates/1510_valueof_operation/Sem_1510_ValueOfOperation_001.ttcn 0 → 100644 +38 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation works as expected for fully initialized templates. ** @verdict pass accept, ttcn3verdict:pass *****************************************************************/ module Sem_1510_ValueOfOperation_001 { type component GeneralComp { } type record ExampleType { integer field1, boolean field2 } template ExampleType m_template := { field1 := 1, field2 := true } testcase TC_Sem_1510_ValueOfOperation_001() runs on GeneralComp { var ExampleType v_value := valueof(m_template); if ((v_value.field1 == 1) and (v_value.field2 == true) ) { setverdict(pass); } else { setverdict(fail); } } control{ execute(TC_Sem_1510_ValueOfOperation_001()); } } No newline at end of file Loading
15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_001.ttcn 0 → 100644 +25 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation rejects valueof with non-concrete values, in this case omit. ** @verdict pass reject *****************************************************************/ module NegSem_1510_ValueOfOperation_001 { type component GeneralComp { } testcase TC_NegSem_1510_ValueOfOperation_001() runs on GeneralComp { var template integer m_int := omit; var integer v_int := valueof(m_int); // if we get here, something must be wrong as valueof on m_int shall cause an error // due to the omit. setverdict(fail); } control{ execute(TC_NegSem_1510_ValueOfOperation_001()); } } No newline at end of file
15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_002.ttcn 0 → 100644 +34 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation rejects valueof with non-concrete values, in this case omit. ** @verdict pass reject *****************************************************************/ module NegSem_1510_ValueOfOperation_002 { type component GeneralComp { } type record ExampleType { integer field1, boolean field2 } template ExampleType m_template := { field1 := *, field2 := ? } testcase TC_NegSem_1510_ValueOfOperation_002() runs on GeneralComp { var ExampleType v_int := valueof(m_template); // if we get here, something must be wrong as valueof on m_template shall cause an error // due to the * and ? wildcards. setverdict(fail); } control{ execute(TC_NegSem_1510_ValueOfOperation_002()); } } No newline at end of file
15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_003.ttcn 0 → 100644 +34 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation rejects non-templates, in this case a structured type. ** @verdict pass reject *****************************************************************/ module NegSem_1510_ValueOfOperation_003 { type component GeneralComp { } type record ExampleType { integer field1, boolean field2 } testcase TC_NegSem_1510_ValueOfOperation_003() runs on GeneralComp { var ExampleType f_first := { field1 := 2, field2 := true }; var ExampleType v_second := valueof(f_first); // if we get here, something must be wrong as valueof on m_template shall cause an error // as it is a value and not a template. setverdict(fail); } control{ execute(TC_NegSem_1510_ValueOfOperation_003()); } } No newline at end of file
15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_004.ttcn 0 → 100644 +26 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation rejects non-templates, in this case a basic type integer. ** @verdict pass reject *****************************************************************/ module NegSem_1510_ValueOfOperation_004 { type component GeneralComp { } testcase TC_NegSem_1510_ValueOfOperation_004() runs on GeneralComp { var integer v_test := 2; var integer v_second := valueof(v_test); // if we get here, something must be wrong as valueof on v_test shall cause an error // as it is not a template. setverdict(fail); } control{ execute(TC_NegSem_1510_ValueOfOperation_004()); } } No newline at end of file
15_templates/1510_valueof_operation/Sem_1510_ValueOfOperation_001.ttcn 0 → 100644 +38 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:15.10, Ensure that the valueof operation works as expected for fully initialized templates. ** @verdict pass accept, ttcn3verdict:pass *****************************************************************/ module Sem_1510_ValueOfOperation_001 { type component GeneralComp { } type record ExampleType { integer field1, boolean field2 } template ExampleType m_template := { field1 := 1, field2 := true } testcase TC_Sem_1510_ValueOfOperation_001() runs on GeneralComp { var ExampleType v_value := valueof(m_template); if ((v_value.field1 == 1) and (v_value.field2 == true) ) { setverdict(pass); } else { setverdict(fail); } } control{ execute(TC_Sem_1510_ValueOfOperation_001()); } } No newline at end of file