Commit 64350679 authored by kovacsa's avatar kovacsa
Browse files

AK update

parent f0252994
Loading
Loading
Loading
Loading
+32 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 521 
 ** @version  0.0.1
 ** @purpose  1:5.2.2, Ensure that identifiers for fields of structured types, enumerated values and groups do not have to be globally unique.
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/
/* The following requirements are tested:
 * Within the same module,they shall only be reused for enumerated values within other enumerated types or as identifiers for fields of structured types. In addition, enumeration values shall not be used as names of value or 
 * template definitions of imported enumeration types, defining the given enumeration value
 */

module Sem_050202_Uniqueness_004 {
	type component GeneralComp {
	}
	type enumerated MyFirstEnumType {MyFirstEnumValue,MySecondEnumValue}; 
    type enumerated MySecondEnumType{MyFirstEnumValue,MySecondEnumValue}; //enumerated values within other enumerated types or as identifiers for fields of structured types
	
    testcase TC_Sem_050202_Uniqueness_004() runs on GeneralComp {

        var MyFirstEnumType     v_enum    :=  MySecondEnumValue;
        var MySecondEnumType    v_enum_2  :=  MySecondEnumValue;
		
        if (match(v_enum,MySecondEnumValue) and match(v_enum_2,MySecondEnumValue)) { // local value
			setverdict(pass);
		} else {
		    setverdict(fail);
		}
	}
	control {
		execute(TC_Sem_050202_Uniqueness_004());
	}
}
+33 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 521 
 ** @version  0.0.1
 ** @purpose  1:5.2.2, Ensure that identifiers for fields of structured types, enumerated values and groups do not have to be globally unique.
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

/* The following requirements are tested:
 * Within the same module,they shall only be reused for enumerated values within other enumerated types or as identifiers for fields of structured types. In addition, enumeration values shall not be used as names of value or 
 * template definitions of imported enumeration types, defining the given enumeration value
 */

module Sem_050202_Uniqueness_005 {
	type component GeneralComp {
	}
	type enumerated MyFirstEnumType {MyInt,MySecondEnumValue}; 
    type integer MyInt;
    
    testcase TC_Sem_050202_Uniqueness_005() runs on GeneralComp {

        var MyFirstEnumType     v_enum :=  MySecondEnumValue;
        var MyInt               v_int  :=  1;    // local scope
		
        if (match(v_enum,MySecondEnumValue) and match(v_int,1)) { 
			setverdict(pass);
		} else {
		    setverdict(fail);
		}
	}
	control {
		execute(TC_Sem_050202_Uniqueness_005());
	}
}
+32 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 521
 ** @version  0.0.1
 ** @purpose  1:6.1.1.1, Access bitstring elements
 ** @verdict  pass reject
 ***************************************************/
/* The following requirements are tested:
 * Only single elements of the string may be accessed. 
 * Trying to assign strings with length 0 or more than 1
 * to a string element using the array-like syntax shall
 * cause an error.
*/

module NegSem_06010101_AccessStringElements_001 {
    
    type component GeneralComp {}
    
    testcase TC_NegSem_06010101_AccessStringElements_001() runs on GeneralComp {
        var octetstring v_b := '100010'O;
        v_b[1] := '01'O;    //error: only individual elements can be accessed
    	if (v_b == '100001'O){
    		setverdict(pass);
    	}
    	else {
    		setverdict(fail, "v_b:",v_b);
    	}
    }
    
    control{
        execute(TC_NegSem_06010101_AccessStringElements_001());
    }
}
 No newline at end of file
+32 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 521
 ** @version  0.0.1
 ** @purpose  1:6.1.1.1, Access bitstring elements
 ** @verdict  pass reject
 ***************************************************/
/* The following requirements are tested:
 * The index shall be between zero and the 
 * length of the string minus one for retrieving 
 * an element from a string. Trying to retrieve outside
 * this range shall cause an error.
*/

module NegSem_06010101_AccessStringElements_002 {
    
    type component GeneralComp {}
    
    testcase TC_NegSem_06010101_AccessStringElements_002() runs on GeneralComp {
        var octetstring v_b := '100010'O;
        v_b[6] := '01'O;    //error: index outside of range
    	if (v_b == '100001'O){
    		setverdict(pass);
    	}
    	else {
    		setverdict(fail, "v_b:",v_b);
    	}
    }
    
    control{
        execute(TC_NegSem_06010101_AccessStringElements_002());
    }
}
 No newline at end of file
+26 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 521
 ** @version  0.0.1
 ** @purpose  1:6.1.1.1, Access universal charstring elements
 ** @verdict  pass reject
 ***************************************************/
/* The following requirements are tested:
 * For assigning an element to the end of a string, the length of the string should be used as 
 * index. Trying to assign an element to the end of a string with an index larger than the 
 * length of the string shall cause an error.
*/

module NegSyn_06010101_AccessStringElements_001 {
    
    type component GeneralComp {}
    
    testcase TC_NegSyn_06010101_AccessStringElements_001() runs on GeneralComp {
        var universal charstring v_b := "AbCdE";
        
        v_b[1] := "FF";        // incorrect legth
    }

    control{
        execute(TC_NegSyn_06010101_AccessStringElements_001());
    }
}
 No newline at end of file
Loading