Commit ee163cca authored by zeiss's avatar zeiss
Browse files

No commit message

No commit message
parent 3614be31
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 150 $
 ** @purpose  1:15.5, Ensure that a modified template does not refer to itself.
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_1505_ModifiedTemplates_001 {

type record of integer MyMessageType;

template MyMessageType m_myBaseTemplate := { 0, 1, 2, 3, 4 };

template MyMessageType m_myOtherTemplate modifies m_myOtherTemplate := { 
	[2]:=3, // switch the positions of 2 and 3 
	[3]:=2 
}

}
 No newline at end of file
+30 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 150 $
 ** @purpose  1:15.5, Ensure that a modified template does not omit possible parameters of the base template.
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_1505_ModifiedTemplates_002 {

type record of integer MyMessageType;

type record MyMessageType {
	integer field1,
	charstring field2,
	boolean field3
}

template MyMessageType m_templateOne(integer p_value) := {
	field1 := p_value,
	field2 := "Hello World",
	field3 := true
}

// illegal definition as the (integer p_value) formal parameter is missing and must
// not be omitted.
template MyMessageType m_templateTwo modifies m_templateOne := {  
	field3 := false
}

}
 No newline at end of file
+36 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 150 $
 ** @purpose  1:15.5, Ensure that a modified template does not omit possible parameters introduced in any modification step.
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_1505_ModifiedTemplates_003 {

type record of integer MyMessageType;

type record MyMessageType {
	integer field1,
	charstring field2,
	boolean field3
}

template MyMessageType m_templateOne(integer p_intValue) := {
	field1 := p_intValue,
	field2 := "Hello World",
	field3 := true
}

template MyMessageType m_templateTwo(integer p_intValue, boolean p_boolValue) modifies m_templateOne := {  
	field1 := p_intValue,
	field3 := p_boolValue
}

// illegal as it is missing the (boolean p_boolValue) formal parameter introduced in the previous
// modification step.
template MyMessageType m_templateThree(integer p_intValue) modifies m_templateTwo := {  
	field2 := "foobar"
}


}
 No newline at end of file
+29 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 150 $
 ** @purpose  1:15.5, Ensure that parameter names in modified templates are the same.
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_1505_ModifiedTemplates_004 {

type component GeneralComp { }

type record MyMessageType {
	integer field1,
	charstring field2,
	boolean field3
}

template MyMessageType m_templateOne(integer p_value) := {
	field1 := p_value,
	field2 := "Hello World",
	field3 := true
}

// illegal as p_intValue is a different parameter name than p_value 
template MyMessageType m_templateTwo(integer p_intValue) modifies m_templateOne := {  
	field3 := false
}

}
 No newline at end of file
+29 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 150 $
 ** @purpose  1:15.5, Ensure that the dash in default parameter values of a modified templates is only accepted when the base template actually has a default value. 
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_1505_ModifiedTemplates_005 {

type component GeneralComp { }

type record MyMessageType {
	integer field1,
	charstring field2,
	boolean field3
}

template MyMessageType m_templateOne(integer p_intValue) := {
	field1 := p_intValue,
	field2 := "Hello World",
	field3 := true
}

// illegal as p_intValue does not have a default value that can be referred to with the "-".
template MyMessageType m_templateTwo(integer p_intValue := -) modifies m_templateOne := {  
	field1 := p_intValue
}

}
 No newline at end of file
Loading