Commit 428d2b1b authored by kovacsa's avatar kovacsa
Browse files

chapter 5 update

parent d2040682
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ type component GeneralComp {
    var boolean vc_bool := false;
}	

testcase TC_Sem_0502_Scope_002() runs on GeneralComp {
testcase TC_Sem_0502_Scope_002_a() runs on GeneralComp {
    if (vc_bool == false){
		vc_bool := true;
		setverdict(pass);
@@ -20,9 +20,9 @@ testcase TC_Sem_0502_Scope_002() runs on GeneralComp {
    }		
}
/*********************************************************************************************
 ** @desc  Test case TC_Sem_0502_Scope_002 shall not effect of the value of boolean vc_bool
 ** @desc  Test case TC_Sem_0502_Scope_002_a shall not effect of the value of boolean vc_bool
 ********************************************************************************************/
testcase TC_Sem_0502_Scope_003() runs on GeneralComp {	    
testcase TC_Sem_0502_Scope_002_b() runs on GeneralComp {	    
    if (vc_bool == false){
		setverdict(pass);
    }
@@ -32,8 +32,8 @@ testcase TC_Sem_0502_Scope_003() runs on GeneralComp {
}

control{  
    execute(TC_Sem_0502_Scope_002());
    execute(TC_Sem_0502_Scope_003());
    execute(TC_Sem_0502_Scope_002_a());
    execute(TC_Sem_0502_Scope_002_b());
}

}
+42 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409 
 ** @version  $Rev$
 ** @desc     Test cases for clause 5.2 Scope rules                     
 ** @purpose  1:5.2, Ensure that the IUT correctly handles definitions of extended component scope
 ** @version  $Rev: 24 $
 ** @purpose  1:5.2, Ensure that the IUT handles scope hierarchy via functions.
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/
module Sem_0502_Scope_009 {
module Sem_0502_Scope_003 {

type component GeneralComp {	    	    
    var integer vc_component := 1;
    var integer vc_int := 0;
}	

type component ExtendedComp extends GeneralComp {	    	    
function f_funcScope() runs on GeneralComp {	    
    vc_int := 1;                          
    if (vc_int == 1){
        setverdict(pass);
    }
    else {
        setverdict(fail);
    }		
}		

testcase TC_Sem_0502_Scope_003_a() runs on GeneralComp {
    f_funcScope();
}

testcase TC_Sem_0502_Scope_009() runs on ExtendedComp {
    if (vc_component == 1) {
testcase TC_Sem_0502_Scope_003_b() runs on GeneralComp {
    f_funcScope();
    if (vc_int == 1){
        setverdict(pass);
    }
    else {
@@ -25,7 +35,8 @@ testcase TC_Sem_0502_Scope_009() runs on ExtendedComp {
}

control{
    execute(TC_Sem_0502_Scope_009());
    execute(TC_Sem_0502_Scope_003_a());
    execute(TC_Sem_0502_Scope_003_b());
}

}
+30 −20
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409
 ** @version  $Rev: 24 $
 ** @purpose  1:5.2, Ensure that the IUT handles scope hierarchy via functions.
 ** @version  $Rev$
 ** @purpose  1:5.2, Ensure that the IUT correctly handles the scope of definitions made in the module part.
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/
module Sem_0502_Scope_004 {

    const integer c_int := 0;

type component GeneralComp {	    	    
    var integer vc_int := 0;
}	

function f_funcScope() runs on GeneralComp {	    
    vc_int := 1;                          
    if (vc_int == 1){
testcase TC_Sem_0502_Scope_004() runs on GeneralComp {
    if (c_int == 0){
		setverdict(pass);
    }
    else {
@@ -20,13 +20,23 @@ function f_funcScope() runs on GeneralComp {
    }		
}	

testcase TC_Sem_0502_Scope_004_a() runs on GeneralComp {
    f_funcScope();
control{  
    execute(TC_Sem_0502_Scope_004());
}
}


module Sem_0502_Scope_004_import {

import from Sem_0502_Scope_004 {
 const all
}

testcase TC_Sem_0502_Scope_004_b() runs on GeneralComp {
    f_funcScope();
    if (vc_int == 1){
type component GeneralComp {	    	    
}	

testcase TC_Sem_0502_Scope_004_import() runs on GeneralComp {
    if (c_int == 0){
		setverdict(pass);
    }
    else {
@@ -35,8 +45,8 @@ testcase TC_Sem_0502_Scope_004_b() runs on GeneralComp {
}	

control{  
    execute(TC_Sem_0502_Scope_004_a());
    execute(TC_Sem_0502_Scope_004_b());
    execute(TC_Sem_0502_Scope_004_import());
}

}

+14 −37
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409 
 ** @version  $Rev$
 ** @purpose  1:5.2, Ensure that the IUT correctly handles the scope of definitions made in the module part.
 ** @verdict  pass accept, ttcn3verdict:pass
 ** @desc     Test cases for clause 5.2 Scope rules                     
 ** @purpose  1:5.2, Ensure that the IUT correctly handles definitions of local scope
 ** @verdict  pass reject
 ***************************************************/
module Sem_0502_Scope_005 {

    const integer c_int := 0;

type component GeneralComp {	    	    
    var integer vc_component := 0;
}	

testcase TC_Sem_0502_Scope_005() runs on GeneralComp {
    if (c_int == 0){
		setverdict(pass);
function f_funcScope() runs on GeneralComp {	    
    var integer v_function := 0;
}		
    else {
        setverdict(fail);

testcase TC_Sem_0502_Scope_005() runs on GeneralComp {
    f_funcScope();
    if (v_function == 0){
    }
}

control{
    var integer v_control := 0;
    execute(TC_Sem_0502_Scope_005());
}
}


module Sem_0502_Scope_005_import {

import from Sem_0502_Scope_005 {
 const all
}

type component GeneralComp {	    	    
}	

testcase TC_Sem_0502_Scope_005_import() runs on GeneralComp {
    if (c_int == 0){
		setverdict(pass);
    }
    else {
        setverdict(fail);
    }		
}	

control{  
    execute(TC_Sem_0502_Scope_005_import());
}
}

+3 −4
Original line number Diff line number Diff line
@@ -12,12 +12,11 @@ type component GeneralComp {
}	

function f_funcScope() runs on GeneralComp {	    
    var integer v_function := 0;
    var integer v_function := 1;
}		

testcase TC_Sem_0502_Scope_006() runs on GeneralComp  {
    f_funcScope();
    if (v_function == 0){
    if (v_control == 0){
    }
}

Loading