Commit 76d7d376 authored by urbant's avatar urbant
Browse files

New tests for 20.2, 20.3, 20.4

parent 4e26a9f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
- NOTE: side effect freedom is tested in 16.3.
 No newline at end of file
- NOTE: side effect are tested in 16.1.4 (restrictions b, c, d)
 No newline at end of file
+43 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.2, dynamic error if a test component is completely blocked
 ** @verdict  pass reject
 *****************************************************************/

// The following requirement is tested:
// The test case shall stop and indicate a dynamic error if a test component is 
// completely blocked. This means none of the alternatives can be chosen, no 
// relevant test component is running, no relevant timer is running and all 
// relevant ports contain at least one message, call, reply or exception that 
// do not match.

module NegSem_2002_TheAltStatement_001 {

    type port MyPort message {
        inout charstring
    }
    
    type component GeneralComp { 
	    port MyPort p;
    }
    
    template charstring m_test := "ping";
    
    testcase TC_NegSem_2002_TheAltStatement_001() runs on GeneralComp {
        timer t_tmr1;
	    p.send(m_test);
	    alt {
		    [] p.receive("abc") {
			    setverdict(pass);
		    }
            [] t_tmr1.timeout {
                setverdict(pass);
            }
	    }
    }
    
    control {
	    execute(TC_NegSem_2002_TheAltStatement_001());
    }
}
 No newline at end of file
+37 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.2, create in guard statements
 ** @verdict  pass reject
 *****************************************************************/

// The following requirement is tested:
// Also, the guard expression shall not use of the operations create, running, 
// alive and activate.

module NegSem_2002_TheAltStatement_002 {

    type port MyPort message {
        inout charstring
    }
    
    type component GeneralComp { 
	    port MyPort p;
    }
    
    template charstring m_test := "ping";
    
    testcase TC_NegSem_2002_TheAltStatement_002() runs on GeneralComp system GeneralComp {
        map(self:p, system: p);
	    p.send(m_test);
	    alt {
		    [GeneralComp.create != null] p.receive(charstring:?) {
			    setverdict(pass);
		    }
	    }
    }
    
    control {
	    execute(TC_NegSem_2002_TheAltStatement_002());
    }
}
 No newline at end of file
+38 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.2, running (timer) in guard statements
 ** @verdict  pass reject
 *****************************************************************/

// The following requirement is tested:
// Also, the guard expression shall not use of the operations create, running, 
// alive and activate.

module NegSem_2002_TheAltStatement_003 {

    type port MyPort message {
        inout charstring
    }
    
    type component GeneralComp { 
	    port MyPort p;
    }
    
    template charstring m_test := "ping";
    
    testcase TC_NegSem_2002_TheAltStatement_003() runs on GeneralComp {
        timer t_tmr := 1.0;
        t_tmr.start;
	    p.send(m_test);
	    alt {
		    [t_tmr.running] p.receive(charstring:?) {
			    setverdict(pass);
		    }
	    }
    }
    
    control {
	    execute(TC_NegSem_2002_TheAltStatement_003());
    }
}
 No newline at end of file
+37 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.2, running (component) in guard statements
 ** @verdict  pass reject
 *****************************************************************/

// The following requirement is tested:
// Also, the guard expression shall not use of the operations create, running, 
// alive and activate.

module NegSem_2002_TheAltStatement_004 {

    type port MyPort message {
        inout charstring
    }
    
    type component GeneralComp { 
	    port MyPort p;
    }
    
    template charstring m_test := "ping";
    
    testcase TC_NegSem_2002_TheAltStatement_004() runs on GeneralComp system GeneralComp {
        map(self:p, system: p);        
	    p.send(m_test);
	    alt {
		    [mtc.running] p.receive(charstring:?) {
			    setverdict(pass);
		    }
	    }
    }
    
    control {
	    execute(TC_NegSem_2002_TheAltStatement_004());
    }
}
 No newline at end of file
Loading