Commit bff379a5 authored by kovacsa's avatar kovacsa
Browse files

AKovacs update

parent 42a02b32
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.1.1, Assign and read universal charstring using USI like notation
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

//Note: not working with TestCast v.6.8.2.5.

/* The following requirements are tested:
 The UCS sequence identifier-like (USI-like) notation using their short identifiers of code point. The USI-like notation is composed of the keyword char followed by parentheses. The
parentheses enclose a comma-separated list of short identifiers . Each short identifier represents a single
character and it shall be composed of a letter U or u followed by an optional "+" PLUS SIGN character,
followed by 1..8 hexadecimal digits. 
*/

module Sem_060101_TopLevel_007 {
    
    type component GeneralComp {}
    
    testcase TC_Sem_060101_TopLevel_007() runs on GeneralComp {
        var universal charstring v_a :=  char(U0041);  //USI notation for character "A"
        var universal charstring v_b :=  char(U0171);  //USI notation for character "ű"
        var universal charstring v_c :=  char(U41);    //USI notation for character "A" without leading zeroes
        var universal charstring v_b :=  char(U+171);  //USI notation for character "ű"  without leading zeroes and + sign notation
         var universal charstring v_d :=  char(U171,U41);  //USI notation for character "ű" and "A"  without leading zeroes and + sign notation
        
    	if ((v_a == "A") and (v_b == "ű") and (v_c == "A") and (v_d == "űA") ){
    		setverdict(pass);
    	}
    	else {
    		setverdict(fail);
    	}
    }
    
    control{
        execute(TC_Sem_060101_TopLevel_007());
    }
}
 No newline at end of file
+21 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.1.2.5, Assign values to pattern restricted character strings without @nocase modifier.
 ** @verdict  pass reject, noexecution
 ***************************************************/

module NegSyn_06010205_StringPattern_001 {
    type charstring MyString (pattern "abc*xyz"); //without @nocase

    type component GeneralComp {}
    
    testcase TC_NegSyn_06010205_StringPattern_001() runs on GeneralComp {
        var MyString v_c;
        v_c := "ABc1234xYz";    //error value is out of constraint: ABc
    }
    
    control{
        execute(TC_NegSyn_06010205_StringPattern_001());
    }
}
 No newline at end of file
+21 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.1.2.5, Assign quadruple values to pattern restricted character strings.
 ** @verdict  pass reject, noexecution
 ***************************************************/

module NegSyn_06010205_StringPattern_002 {
    type charstring MyString (pattern "\q{0,0,1,116}abc"); //error: is not a legal character of the TTCN 3 charstring type

    
    type component GeneralComp {}
    
    testcase TC_NegSyn_06010205_StringPattern_002() runs on GeneralComp {
        var MyString v_c := "Ŵabc";    //error: is not a legal character of the TTCN 3 charstring type
    }
    
    control{
        execute(TC_NegSyn_06010205_StringPattern_002());
    }
}
 No newline at end of file
+33 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.1.2.5, Assign values to pattern restricted character strings with @nocase modifier.
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

/* The following requirements are tested:
When the "@nocase" modifier is used after the pattern keyword, the matching is evaluated in a case insensitive way.
*/

module Sem_06010205_StringPattern_003 {
    type charstring MyString (pattern @nocase "abc*xyz"); // with @nocase modifier now characters from "A...Z" is also allowed 

    type component GeneralComp {}
    
    testcase TC_Sem_06010205_StringPattern_003() runs on GeneralComp {
        
        var MyString v_c;
        
        //valid:
        v_c := "ABc1234xyz";
        v_c := "aBC:xYz";
        v_c := "AbC.xyZ";
        v_c := "ABc*xYZ";
        v_c := "ABC?XYZ";
		setverdict(pass);
    }
    
    control{
        execute(TC_Sem_06010205_StringPattern_003());
    }
}
 No newline at end of file
+31 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.1.2.6.2, Assign values to pattern restricted character strings using @nocase modifier
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

/* The following requirements are tested:
When the "@nocase" modifier is used after the pattern keyword, the matching is evaluated in a case insensitive way
*/

module Sem_0601020602_StringMixing_007 {
    type charstring unicharString (pattern "[a-z]#(1,5)") length (1..5); // charstring between "a".."z" and length from 1 to 5
    type charstring unicharString_nocase (pattern @nocase "[a-z]#(1,5)") length (1..5); // with @nocase modifier now characters from "A...Z" is also allowed 

    type component GeneralComp {}
    
    testcase TC_Sem_0601020602_StringMixing_007() runs on GeneralComp {
        var unicharString v_a;        //without @nocase modifier
        var unicharString_nocase v_b; //with @nocase modifier
        v_a :="abxyz";
        v_b :=v_a;        //v_b :="abxyz";
        v_b :="AbXyZ";      

      	setverdict(pass);
    }
    
    control{
        execute(TC_Sem_0601020602_StringMixing_007());
    }
}
 No newline at end of file
Loading