pax_global_header 0000666 0000000 0000000 00000000064 11214173474 0014516 g ustar 00root root 0000000 0000000 52 comment=3bd6fd7555a804c120e50592374231d8e4bed99f
LibCommon-v1.3.0@25/ 0000775 0000000 0000000 00000000000 11214173474 0014033 5 ustar 00root root 0000000 0000000 LibCommon-v1.3.0@25/LibCommon_AbstractData.ttcn 0000664 0000000 0000000 00000011323 11214173474 0021221 0 ustar 00root root 0000000 0000000 /**
* @author ETSI
* @version $URL$
* $Id$
* @desc A collection of functions for abstract data types which may be
* useful in the implementation of any TTCN-3 test suite.
* @remark End users should be aware that any changes made to the in
* definitions this module may be overwritten in future releases.
* End users are encouraged to contact the distributers of this
* module regarding their modifications or additions so that future
* updates will include your changes.
*/
module LibCommon_AbstractData {
import from LibCommon_BasicTypesAndValues { type UInt } ;
group stringStack {
type record StringStack {
UInt stackSize,
StringItems stringItems
}
type record of charstring StringItems;
/**
* @desc Constant which can be used to initialize a
* string stack. A string stack can be intialized by
* assigning this value in the variable declariation.
* An alternative is to call the initlialization function.
* @see LibCommon_AbstractData.f_initStringStack
* @remark Note that an initlialized stack stack is not
* necessarily the same as an empty string stack.
* An empty tring stack as 0 zero elements but may
* have a non empty list of (empty) items.
*/
const StringStack c_initStringStack := { 0, {} }
/**
* @desc The invocation of this function will initialize
* a string stack to an empty string stack.
* An alternative is to initlialize a stack using a
* constant value.
* @see LibCommon_AbstractData.c_initStringStack
* @param p_stack String stack to be initialized.
*/
function f_initStringStack ( inout StringStack p_stack ) {
p_stack := c_initStringStack
}
/**
* @desc This function checks if a string stack is empty.
* @param p_stack String stack to be checked.
* @return true if empty, false if not empty
*/
function f_isStringStackEmpty ( inout StringStack p_stack )
return boolean {
if ( p_stack.stackSize == 0 ) {return true}
else {return false}
}
/**
* @desc This function checks if a given string is on the
* string stack.
* @param p_stack String stack where the string item
* is to be looked for.
* @param p_item String to be checked for.
* @return true if found, false if not found
*/
function f_isItemOnStringStack ( inout StringStack p_stack,
in charstring p_item )
return boolean {
var integer i;
for (i := 0; i < p_stack.stackSize; i := i+1 ) {
if ( p_stack.stringItems[i] == p_item ) {
return true;
}
}
return false;
}
/**
* @desc This function checks if a given string is on the
* string stack.
* @param p_stack String stack where the string item
* is to be looked for.
* @param p_item String item on top of the stack.
* @return false if stack is empty, true otherwise
*/
function f_peekStringStackTop ( inout StringStack p_stack,
out charstring p_item)
return boolean {
if (p_stack.stackSize == 0) {
p_item := "f_peekTopStringStack: String stack is empty!";
return false;
}
p_item := p_stack.stringItems[p_stack.stackSize-1];
return true;
}
/**
* @desc This function puts a string to the top of a
* string stack.
* @param p_stack String stack to which the string item
* is to be added.
* @param p_item String to be added.
*/
function f_pushStringStack ( inout StringStack p_stack,
in charstring p_item ) {
p_stack.stringItems[p_stack.stackSize] := p_item;
p_stack.stackSize := p_stack.stackSize + 1;
}
/**
* @desc This function removes the string from the top of a
* string stack. If the stack is empty nothing is done
* @param p_stack String stack from which the top string item
* is to be removed.
*/
function f_popStringStack ( inout StringStack p_stack ) {
if ( p_stack.stackSize > 0 ) {
p_stack.stackSize := p_stack.stackSize-1;
// "delete" top stack item to be safe
// Note: due to record of index the "old top" is size-1!
p_stack.stringItems[p_stack.stackSize] := "";
}
}
} // end group stringStack
} // end module LibCommon_AbstractData
LibCommon-v1.3.0@25/LibCommon_BasicTypesAndValues.ttcn 0000664 0000000 0000000 00000026421 11214173474 0022542 0 ustar 00root root 0000000 0000000 /**
* @author ETSI
* @version $URL$
* $Id$
* @desc A collection of basic type and value definitions which may be
* useful in the implementation of any TTCN-3 test suite.
* @remark End users should be aware that any changes made to the in
* definitions this module may be overwritten in future releases.
* End users are encouraged to contact the distributers of this
* module regarding their modifications or additions so that future
* updates will include your changes.
*/
module LibCommon_BasicTypesAndValues {
/**
* @remark Number in subtype name always indicates encoding length
* in _bits_
*/
group unsignedIntegerDefintions {
const integer c_uInt1Max := 1;
const integer c_uInt2Max := 3;
const integer c_uInt3Max := 7;
const integer c_uInt4Max := 15;
const integer c_uInt5Max := 31;
const integer c_uInt6Max := 63;
const integer c_uInt7Max := 127;
const integer c_uInt8Max := 255;
const integer c_uInt9Max := 511;
const integer c_uInt10Max := 1023;
const integer c_uInt11Max := 2047;
const integer c_uInt12Max := 4095;
const integer c_uInt13Max := 8191;
const integer c_uInt14Max := 16383;
const integer c_uInt15Max := 32767;
const integer c_uInt16Max := 65535;
const integer c_uInt17Max := 131071;
const integer c_uInt18Max := 262143;
const integer c_uInt19Max := 524287;
const integer c_uInt20Max := 1048575;
const integer c_uInt21Max := 2097151;
const integer c_uInt22Max := 4194303;
const integer c_uInt23Max := 8388607;
const integer c_uInt24Max := 16777215;
const integer c_uInt25Max := 33554431;
const integer c_uInt26Max := 67108863;
const integer c_uInt27Max := 134217727;
const integer c_uInt28Max := 268435456;
const integer c_uInt29Max := 536870911;
const integer c_uInt30Max := 1073741823;
const integer c_uInt31Max := 2147483647;
const integer c_uInt32Max := 4294967295;
const integer c_uInt36Max := 68719476735;
const integer c_uInt48Max := 281474976710655;
const integer c_uInt52Max := 4503599627370495;
type integer UInt (0 .. infinity);
type integer UInt1 (0 .. c_uInt1Max) with {variant "unsigned 1 bit"};
type integer UInt2 (0 .. c_uInt2Max) with {variant "unsigned 2 bit"};
type integer UInt3 (0 .. c_uInt3Max) with {variant "unsigned 3 bit"};
type integer UInt4 (0 .. c_uInt4Max) with {variant "unsigned 4 bit"};
type integer UInt5 (0 .. c_uInt5Max) with {variant "unsigned 5 bit"};
type integer UInt6 (0 .. c_uInt6Max) with {variant "unsigned 6 bit"};
type integer UInt7 (0 .. c_uInt7Max) with {variant "unsigned 7 bit"};
type integer UInt8 (0 .. c_uInt8Max) with {variant "unsigned 8 bit"};
type integer UInt9 (0 .. c_uInt9Max) with {variant "unsigned 9 bit"};
type integer UInt10 (0 .. c_uInt10Max) with {variant "unsigned 10 bit"};
type integer UInt11 (0 .. c_uInt11Max) with {variant "unsigned 11 bit"};
type integer UInt12 (0 .. c_uInt12Max) with {variant "unsigned 12 bit"};
type integer UInt13 (0 .. c_uInt13Max) with {variant "unsigned 13 bit"};
type integer UInt14 (0 .. c_uInt14Max) with {variant "unsigned 14 bit"};
type integer UInt15 (0 .. c_uInt15Max) with {variant "unsigned 15 bit"};
type integer UInt16 (0 .. c_uInt16Max) with {variant "unsigned 16 bit"};
type integer UInt17 (0 .. c_uInt17Max) with {variant "unsigned 17 bit"};
type integer UInt18 (0 .. c_uInt18Max) with {variant "unsigned 18 bit"};
type integer UInt19 (0 .. c_uInt19Max) with {variant "unsigned 19 bit"};
type integer UInt20 (0 .. c_uInt20Max) with {variant "unsigned 20 bit"};
type integer UInt21 (0 .. c_uInt21Max) with {variant "unsigned 21 bit"};
type integer UInt22 (0 .. c_uInt22Max) with {variant "unsigned 22 bit"};
type integer UInt23 (0 .. c_uInt23Max) with {variant "unsigned 23 bit"};
type integer UInt24 (0 .. c_uInt24Max) with {variant "unsigned 24 bit"};
type integer UInt25 (0 .. c_uInt25Max) with {variant "unsigned 25 bit"};
type integer UInt26 (0 .. c_uInt26Max) with {variant "unsigned 26 bit"};
type integer UInt27 (0 .. c_uInt27Max) with {variant "unsigned 27 bit"};
type integer UInt28 (0 .. c_uInt28Max) with {variant "unsigned 28 bit"};
type integer UInt29 (0 .. c_uInt29Max) with {variant "unsigned 29 bit"};
type integer UInt30 (0 .. c_uInt30Max) with {variant "unsigned 30 bit"};
type integer UInt31 (0 .. c_uInt31Max) with {variant "unsigned 31 bit"};
type integer UInt32 (0 .. c_uInt32Max) with {variant "unsigned 32 bit"};
type integer UInt36 (0 .. c_uInt36Max) with {variant "unsigned 36 bit"};
type integer UInt48 (0 .. c_uInt48Max) with {variant "unsigned 48 bit"};
type integer UInt52 (0 .. c_uInt52Max) with {variant "unsigned 52 bit"};
} // end group unsignedIntegerDefintions
/**
* @remark Number in subtype name always indicates encoding length
* in _bits_
*/
group signedIntegerDefintions {
const integer c_int1Min := -1;
const integer c_int1Max := 0;
const integer c_int2Min := -2;
const integer c_int2Max := 1;
const integer c_int3Min := -4;
const integer c_int3Max := 3;
const integer c_int4Min := -8;
const integer c_int4Max := 7;
const integer c_int5Min := -16;
const integer c_int5Max := 15;
const integer c_int6Min := -32;
const integer c_int6Max := 31;
const integer c_int7Min := -64;
const integer c_int7Max := 63;
const integer c_int8Min := -128;
const integer c_int8Max := 127;
const integer c_int9Min := -256;
const integer c_int9Max := 255;
const integer c_int10Min := -512;
const integer c_int10Max := 511;
const integer c_int11Min := -1024;
const integer c_int11Max := 1023;
const integer c_int12Min := -2048;
const integer c_int12Max := 2047;
const integer c_int13Min := -4096;
const integer c_int13Max := 4095;
const integer c_int14Min := -8192;
const integer c_int14Max := 8191;
const integer c_int15Min := -16384;
const integer c_int15Max := 16383;
const integer c_int16Min := -32768;
const integer c_int16Max := 32767;
const integer c_int17Min := -65536;
const integer c_int17Max := 65535;
const integer c_int18Min := -131072;
const integer c_int18Max := 131071;
const integer c_int19Min := -262144;
const integer c_int19Max := 262143;
const integer c_int20Min := -524288;
const integer c_int20Max := 524287;
const integer c_int21Min := -1048576;
const integer c_int21Max := 1048575;
const integer c_int22Min := -2097152;
const integer c_int22Max := 2097151;
const integer c_int23Min := -4194304;
const integer c_int23Max := 4194303;
const integer c_int24Min := -8388608;
const integer c_int24Max := 8388607;
const integer c_int25Min := -16777216;
const integer c_int25Max := 16777215;
const integer c_int26Min := -33554432;
const integer c_int26Max := 33554431;
const integer c_int27Min := -67108864;
const integer c_int27Max := 67108863;
const integer c_int28Min := -134217728;
const integer c_int28Max := 134217727;
const integer c_int29Min := -268435456;
const integer c_int29Max := 268435456;
const integer c_int30Min := -536870912;
const integer c_int30Max := 536870911;
const integer c_int31Min := -1073741824;
const integer c_int31Max := 1073741823;
const integer c_int32Min := -2147483648;
const integer c_int32Max := 2147483647;
type integer Int;
type integer Int1 (c_int1Min .. c_int1Max) with { variant "1 bit"};
type integer Int2 (c_int2Min .. c_int2Max) with { variant "2 bit"};
type integer Int3 (c_int3Min .. c_int3Max) with { variant "3 bit"};
type integer Int4 (c_int4Min .. c_int4Max) with { variant "4 bit"};
type integer Int5 (c_int5Min .. c_int5Max) with { variant "5 bit"};
type integer Int6 (c_int6Min .. c_int6Max) with { variant "6 bit"};
type integer Int7 (c_int7Min .. c_int7Max) with { variant "7 bit"};
type integer Int8 (c_int8Min .. c_int8Max) with { variant "8 bit"};
type integer Int9 (c_int9Min .. c_int9Max) with { variant "9 bit"};
type integer Int10 (c_int10Min .. c_int10Max) with { variant "10 bit"};
type integer Int11 (c_int11Min .. c_int11Max) with { variant "11 bit"};
type integer Int12 (c_int12Min .. c_int12Max) with { variant "12 bit"};
type integer Int13 (c_int13Min .. c_int13Max) with { variant "13 bit"};
type integer Int14 (c_int14Min .. c_int14Max) with { variant "14 bit"};
type integer Int15 (c_int15Min .. c_int15Max) with { variant "15 bit"};
type integer Int16 (c_int16Min .. c_int16Max) with { variant "16 bit"};
type integer Int17 (c_int17Min .. c_int17Max) with { variant "17 bit"};
type integer Int18 (c_int18Min .. c_int18Max) with { variant "18 bit"};
type integer Int19 (c_int19Min .. c_int19Max) with { variant "19 bit"};
type integer Int20 (c_int20Min .. c_int20Max) with { variant "20 bit"};
type integer Int21 (c_int21Min .. c_int21Max) with { variant "21 bit"};
type integer Int22 (c_int22Min .. c_int22Max) with { variant "22 bit"};
type integer Int23 (c_int23Min .. c_int23Max) with { variant "23 bit"};
type integer Int24 (c_int24Min .. c_int24Max) with { variant "24 bit"};
type integer Int25 (c_int25Min .. c_int25Max) with { variant "25 bit"};
type integer Int26 (c_int26Min .. c_int26Max) with { variant "26 bit"};
type integer Int27 (c_int27Min .. c_int27Max) with { variant "27 bit"};
type integer Int28 (c_int28Min .. c_int28Max) with { variant "28 bit"};
type integer Int29 (c_int29Min .. c_int29Max) with { variant "29 bit"};
type integer Int30 (c_int30Min .. c_int30Max) with { variant "30 bit"};
type integer Int31 (c_int31Min .. c_int31Max) with { variant "31 bit"};
type integer Int32 (c_int32Min .. c_int32Max) with { variant "32 bit"};
} // end group signedIntegerDefintions
group zeroedIntegers {
const UInt1 c_uInt1Zero := 0;
const UInt2 c_uInt2Zero := 0;
const UInt3 c_uInt3Zero := 0;
const UInt4 c_uInt4Zero := 0;
const UInt5 c_uInt5Zero := 0;
const UInt6 c_uInt6Zero := 0;
const UInt7 c_uInt7Zero := 0;
const UInt8 c_uInt8Zero := 0;
const UInt12 c_uInt12Zero := 0;
const UInt14 c_uInt14Zero := 0;
const UInt16 c_uInt16Zero := 0;
const UInt32 c_uInt32Zero := 0;
}//end group zeroedInt
/**
* @remark Number in subtype name always indicates encoding length
* in _bits_
*/
group booleanDefintions {
type boolean Bool1 with { variant "1 bit" };
type boolean Bool2 with { variant "2 bit" };
type boolean Bool3 with { variant "3 bit" };
type boolean Bool4 with { variant "4 bit" };
type boolean Bool5 with { variant "5 bit" };
type boolean Bool6 with { variant "6 bit" };
type boolean Bool7 with { variant "7 bit" };
type boolean Bool8 with { variant "8 bit" };
} // end group booleanDefintions
} // end module LibCommon_BasicTypesAndValues
LibCommon-v1.3.0@25/LibCommon_DataStrings.ttcn 0000664 0000000 0000000 00000017036 11214173474 0021116 0 ustar 00root root 0000000 0000000 /**
*
* @author ETSI
* @version $URL$
* $Id$
* @desc A collection of data string type and value definitions which
* may be useful in the implementation of any TTCN-3 test
* suite. "Data string" refers to TTCN-3 hexstring, octetstring
* and bitstring types.
* @remark End users should be aware that any changes made to the in
* definitions this module may be overwritten in future releases.
* End users are encouraged to contact the distributers of this
* module regarding their modifications or additions so that future
* updates will include your changes.
*/
module LibCommon_DataStrings {
/**
* @remark Number in name indicates string length in number of
* _bits_
*/
group bitStringSubTypes {
type bitstring Bit1 length(1) with {encode "length(1)"};
type bitstring Bit2 length(2) with {encode "length(2)"};
type bitstring Bit3 length(3) with {encode "length(3)"};
type bitstring Bit4 length(4) with {encode "length(4)"};
type bitstring Bit5 length(5) with {encode "length(5)"};
type bitstring Bit6 length(6) with {encode "length(6)"};
type bitstring Bit7 length(7) with {encode "length(7)"};
type bitstring Bit8 length(8) with {encode "length(8)"};
type bitstring Bit9 length(9) with {encode "length(9)"};
type bitstring Bit10 length(10) with {encode "length(10)"};
type bitstring Bit11 length(11) with {encode "length(11)"};
type bitstring Bit12 length(12) with {encode "length(12)"};
type bitstring Bit13 length(13) with {encode "length(13)"};
type bitstring Bit14 length(14) with {encode "length(14)"};
type bitstring Bit15 length(15) with {encode "length(15)"};
type bitstring Bit16 length(16) with {encode "length(16)"};
type bitstring Bit17 length(17) with {encode "length(17)"};
type bitstring Bit18 length(18) with {encode "length(18)"};
type bitstring Bit19 length(19) with {encode "length(19)"};
type bitstring Bit20 length(20) with {encode "length(20)"};
type bitstring Bit21 length(21) with {encode "length(21)"};
type bitstring Bit22 length(22) with {encode "length(22)"};
type bitstring Bit23 length(23) with {encode "length(23)"};
type bitstring Bit24 length(24) with {encode "length(24)"};
type bitstring Bit25 length(25) with {encode "length(25)"};
type bitstring Bit26 length(26) with {encode "length(26)"};
type bitstring Bit27 length(27) with {encode "length(27)"};
type bitstring Bit28 length(28) with {encode "length(28)"};
type bitstring Bit29 length(29) with {encode "length(29)"};
type bitstring Bit30 length(30) with {encode "length(30)"};
type bitstring Bit31 length(31) with {encode "length(31)"};
type bitstring Bit32 length(32) with {encode "length(32)"};
type bitstring Bit40 length(40) with {encode "length(40)"};
type bitstring Bit48 length(48) with {encode "length(48)"};
type bitstring Bit64 length(64) with {encode "length(64)"};
type bitstring Bit72 length(72) with {encode "length(72)"};
type bitstring Bit128 length(128) with {encode "length(128)"};
type bitstring Bit144 length(144) with {encode "length(144)"};
} // end group bitStringSubTypes
group zeroedBits {
const Bit1 c_1ZeroBit := int2bit(0,1);
const Bit2 c_2ZeroBits := int2bit(0,2);
const Bit4 c_4ZeroBits := int2bit(0,4);
const Bit5 c_5ZeroBits := int2bit(0,5);
const Bit6 c_6ZeroBits := int2bit(0,6);
const Bit8 c_8ZeroBits := int2bit(0,8);
const Bit14 c_14ZeroBits := int2bit(0,14);
const Bit64 c_64ZeroBits := int2bit(0,64);
}//end group zeroedBits
/**
* @remark Number in name indicates string length in number of
* _octets_
*/
group octetStringSubTypes {
type octetstring Oct1 length(1) with {encode "length(1)"};
type octetstring Oct2 length(2) with {encode "length(2)"};
type octetstring Oct3 length(3) with {encode "length(3)"};
type octetstring Oct4 length(4) with {encode "length(4)"};
type octetstring Oct5 length(5) with {encode "length(5)"};
type octetstring Oct6 length(6) with {encode "length(6)"};
type octetstring Oct7 length(7) with {encode "length(7)"};
type octetstring Oct8 length(8) with {encode "length(8)"};
type octetstring Oct9 length(9) with {encode "length(9)"};
type octetstring Oct10 length(10) with {encode "length(10)"};
type octetstring Oct11 length(11) with {encode "length(11)"};
type octetstring Oct12 length(12) with {encode "length(12)"};
type octetstring Oct13 length(13) with {encode "length(13)"};
type octetstring Oct14 length(14) with {encode "length(14)"};
type octetstring Oct15 length(15) with {encode "length(15)"};
type octetstring Oct16 length(16) with {encode "length(16)"};
type octetstring Oct20 length(20) with {encode "length(20)"};
type octetstring Oct64 length(64) with {encode "length(64)"};
type octetstring Oct80 length(80) with {encode "length(80)"};
type octetstring Oct128 length(128) with {encode "length(128)"};
type octetstring Oct160 length(160) with {encode "length(160)"};
type octetstring Oct320 length(320) with {encode "length(320)"};
type octetstring Oct640 length(640) with {encode "length(640)"};
type octetstring Oct1280 length(1280) with {encode "length(1280)"};
type octetstring Oct1380 length(1380) with {encode "length(1380)"};
type octetstring Oct0to16 length(0..16) with {encode "length(0..16)"};
type octetstring Oct0to127 length(0..127) with {encode "length(0..127)"};
type octetstring Oct0to255 length(0..255) with {encode "length(0..255)"};
type octetstring Oct1to15 length(1..15) with {encode "length(1..15)"};
type octetstring Oct1to128 length(1..128) with {encode "length(1..128)"};
type octetstring Oct1to254 length(1..254) with {encode "length(1..254)"};
type octetstring Oct1to255 length(1..255) with {encode "length(1..255)"};
type octetstring Oct4to16 length(4..16) with {encode "length(4..16)"};
type octetstring Oct6to15 length(6..15) with {encode "length(6..15)"};
} // end group octetStringSubTypes
group zeroedBytes {
const Oct1 c_1ZeroByte := int2oct(0,1);
const Oct2 c_2ZeroBytes := int2oct(0,2);
const Oct4 c_4ZeroBytes := int2oct(0,4);
const Oct6 c_6ZeroBytes := int2oct(0,6);
const Oct8 c_8ZeroBytes := int2oct(0,8);
const Oct9 c_9ZeroBytes := int2oct(0,9);
const Oct12 c_12ZeroBytes := int2oct(0,12);
const Oct16 c_16ZeroBytes := int2oct(0,16);
const Oct20 c_20ZeroBytes := int2oct(0,20);
const Oct80 c_80ZeroBytes := int2oct(0,80);
const Oct160 c_160ZeroBytes := int2oct(0,160);
const Oct320 c_320ZeroBytes := int2oct(0,320);
const Oct640 c_640ZeroBytes := int2oct(0,640);
const Oct1280 c_1280ZeroBytes := int2oct(0,1280);
const Oct1380 c_1380ZeroBytes := int2oct(0,1380);
const octetstring c_256ZeroBytes := int2oct(0,256);
const octetstring c_1KZeroBytes := int2oct(0,1024);
const octetstring c_4KZeroBytes := int2oct(0,4096);
const octetstring c_16KZeroBytes := int2oct(0,16384);
const octetstring c_64KZeroBytes := int2oct(0,65536);
const octetstring c_128KZeroBytes := int2oct(0,131072);
}//end group zeroedBytes
} // end module LibCommon_DataStrings
LibCommon-v1.3.0@25/LibCommon_Sync.ttcn 0000664 0000000 0000000 00000151111 11214173474 0017600 0 ustar 00root root 0000000 0000000 /**
* @author ETSI
* @version $URL$
* $Id$
* @desc This module implements _one_ generic synchronization mechanism
* for TTCN-3 test cases with one or more test components.
* Key concept is here that one test component acts as a
* synchronization server which listens and triggers one or more
* synchronization clients. It is recomended to use the MTC always as
* the synchronization server but in theory also a PTC can act as such
* a server.
* This synchronization is used by calling a function on
* the server test component to wait for a desired amount of clients
* to notify the server that they have reached a specific synchronization
* point. Each client test component must call another
* function to perform this notification.
* In the event that a client is not able to reach a synchronization
* point the server sends out a signal to all clients to abort the
* test case. This signal is a STOP message which can be caught by
* a test component default which in turn can then run a proper
* shut down behavior based on the current state of the test
* component.
* Note that this synchronization mechanism can also be used
* in a special mode called "self synchronization" when a test case
* only has one test component. Here, the test component in essence
* acts as a server and client at the same time. The main benefit of
* using self synchoronization is that the same shutdown mechanisms
* can also be reused fomr the multi component test cases.
* This module contains a lot of TTCN-3 definitions. It has been
* structured into tree main groups to help the user to identify
* quickly relevant TTCN-3 definitions. For rookie users of this
* module basicUserRelevantDefinitions should offer all the needed
* definitions. Advanced users can consider use of definitions in
* advancedUserRelevantDefinitions. Finally, internalDefinitions
* are definitions which are required for the module to work
* properly but do not need to be used in your code. Remember that
* the main motiviation of this sychronization module is to offer
* are _simple_ user interface. Practice has shown that when writing
* actual test component behavior _only a handful_ of functions
* usually wind up being used! Also check the synchronization examples
* module for example uses of this synchronization mechanism.
* The invocation of the sync functions is also closely tied
* to the verdict control functions which should also be reviewed
* prior to using this module.
* This module has been derived from EtsiCommon_Synchronization
* which was created in ETSIs STF256/276. It has been kept
* intentionally separate to avoid conflicts with future ETSI
* test suite releases.
* @see LibCommon_Sync.basicUserRelevantDefinitions
* @see LibCommon_Sync.advancedUserRelevantDefinitions
* @remark End users should be aware that any changes made to the in
* definitions this module may be overwritten in future releases.
* End users are encouraged to contact the distributers of this
* module regarding their modifications or additions so that future
* updates will include your changes.
*/
module LibCommon_Sync {
//Common
import from LibCommon_BasicTypesAndValues { type UInt } ;
import from LibCommon_AbstractData all;
import from LibCommon_VerdictControl all;
group basicUserRelevantDefinitions {
group importantSyncTypeDefinitions {
group compTypeRelated {
/**
* @desc This type is used to be the base of any synchronization
* behavior which is to be executed on a sync server
* component. The test component which acts as a
* sync server in a test case must NOT directly use
* this component type in its runs on clause!
* Note that server synchronization functions may be
* invoked by a test component as long as its
* component type is type compatible to this component
* type definition!
*/
type component BaseSyncComp {
port SyncPort syncPort;
timer tc_sync := PX_TSYNC_TIME_LIMIT;
}
/**
* @desc This type is used to define any synchronization
* behavior which is to be executed on a sync server
* component. The test component which acts as a
* sync server in a test case may - but does
* not have to - directly use this component type its
* runs on clause.
* Note that server synchronization functions may be
* invoked by a test component as long as its
* component type is type compatible to this component
* type definition!
*/
type component ServerSyncComp {
timer tc_shutDown := PX_TSHUT_DOWN_TIME_LIMIT;
// definitions for BaseSyncComp
port SyncPort syncPort;
timer tc_sync := PX_TSYNC_TIME_LIMIT;
} with { extension "extends BaseSyncComp" }
/**
* @desc This type is used to define any synchronization
* behavior which is to be executed on a sync client
* component. The test component(s) which act as a
* sync client in a test case may - but do not have
* to - directly use this component type their runs
* on clause.
* Note that server synchronization functions may be
* invoked by a test component as long as its
* component type is type compatible to this component
* type definition!
*/
type component ClientSyncComp {
var StringStack v_stateStack:= c_initStringStack;
// definitions for BaseSyncComp
port SyncPort syncPort;
timer tc_sync := PX_TSYNC_TIME_LIMIT;
} with { extension "extends BaseSyncComp" }
/**
* @desc This type is used to define any synchronization
* behavior which is relevant to non-concurrent test
* cases.
* Note that self synchronization functions may be
* invoked by a test component as long as its
* component type is type compatible to this component
* type definition!
* Note also that this type is type compatible to the
* ClientSyncComp type so that shutdown altsteps from
* concurrent test cases can also be reused in single
* component test cases!
* @see LibCommon_Sync.ClientSyncComp
*/
type component SelfSyncComp {
port SyncPort syncSendPort;
// definitions for ClientSyncComp
var StringStack v_stateStack:= c_initStringStack;
port SyncPort syncPort;
timer tc_sync := PX_TSYNC_TIME_LIMIT;
} with { extension "extends ClientSyncComp" }
/**
* @desc This port type must be imported into test suites
* when defining test component types which are
* type compatible to a synchronization component
* type
* @see LibCommon_Sync.SelfSyncComp
* @see LibCommon_Sync.ServerSyncComp
* @see LibCommon_Sync.ClientSyncComp
*/
type port SyncPort message { inout SyncCmd }
} // end compTypeRelated
group standardSyncPointNames {
const charstring c_prDone := "preambleDone";
const charstring c_poDone := "postambleDone";
const charstring c_tbDone := "testBodyDone";
const charstring c_initDone := "initDone";
}
} // end group importantSyncTypeDefinitions
group syncCompTestConfiguration {
/**
* @desc Calls self connect function if invoking
* component is the MTC or otherwise connects the client
* the server. This function allows to implement preambles
* in a way that they can be used by test components
* in both non-concurrent as well as concurrent test
* cases!
* @remark This function should _not_ be called if the MTC
* acts as a client (and not a server) in a concurrent
* test case. In this case f_connect4ClientSync
* should be used instead.
* @see LibCommon_Sync.f_connect4SelfSync
* @see LibCommon_Sync.f_connect4ClientSync
*/
function f_connect4SelfOrClientSync()
runs on SelfSyncComp {
if ( self == mtc ) {
f_connect4SelfSync();
} else {
f_connect4ClientSync();
}
}
/**
* @desc Calls self connect function if the invoking
* component is the MTC or otherwise disconnects the client
* from the server. This function allows to implement
* postambles in a way that they can be used in both
* non-concurrent as well as concurrent test cases.
* @remark This function should _not_ be called if the MTC
* acts as a client (and not a server) in a concurrent
* test case. In this case f_disconnect4ClientSync
* should be used instead.
* @see LibCommon_Sync.f_disconnect4SelfSync
* @see LibCommon_Sync.f_disconnect4ClientSync
*/
function f_disconnect4SelfOrClientSync()
runs on SelfSyncComp {
if ( self == mtc ) {
f_disconnect4SelfSync();
} else {
f_disconnect4ClientSync();
}
}
} // end group syncCompTestConfiguration
group syncFunctions {
/**
* @desc Implements synchronization of 2 clients from server side
* on one or more synchronization points.
* If problem occurs, then server sends STOP to all clients.
* Waits for PX_TSYNC_TIME_LIMIT to let clients
* finish executing their behavior until this
* synchronization point. After passing all synchronization
* points successfuly the server waits for all clients
* to stop.
* See f_serverSyncClientsTimed for overwriting this
* the timing constraint!
* This function sets the server component verdict.
* @remark The use of this function requires prior connection of
* the server sync ports!
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT
* @see LibCommon_Sync.f_serverSyncClientsTimed
* @see LibCommon_Sync.f_serverWaitForAllClientsToStop
* @param p_syncPointIds list of synchronization point name/ids
*/
function f_serverSync2ClientsAndStop( in SyncPointList p_syncPointIds )
runs on ServerSyncComp {
var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
f_serverSyncClientsTimed(2,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
}
f_serverWaitForAllClientsToStop();
}
/**
* @desc Implements synchronization of 3 clients from server side
* on one or more synchronization points.
* If problem occurs, then server sends STOP to all clients.
* Waits for PX_TSYNC_TIME_LIMIT to let clients
* finish executing their behavior until this
* synchronization point. After passing all synchronization
* points successfuly the server waits for all clients
* to stop.
* See f_serverSyncClientsTimed for overwriting this
* the timing constraint!
* This function sets the server component verdict.
* @remark The use of this function requires prior connection of
* the server sync ports!
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT
* @see LibCommon_Sync.f_serverSyncClientsTimed
* @see LibCommon_Sync.f_serverWaitForAllClientsToStop
* @param p_syncPointIds list of synchronization point name/ids
*/
function f_serverSync3ClientsAndStop( in SyncPointList p_syncPointIds )
runs on ServerSyncComp {
var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
f_serverSyncClientsTimed(3,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
}
f_serverWaitForAllClientsToStop();
}
/**
* @desc Implements synchronization of 4 clients from server side
* on one or more synchronization points.
* If problem occurs, then server sends STOP to all clients.
* Waits for PX_TSYNC_TIME_LIMIT to let clients
* finish executing their behavior until this
* synchronization point. After passing all synchronization
* points successfuly the server waits for all clients
* to stop.
* See f_serverSyncClientsTimed for overwriting this
* the timing constraint!
* This function sets the server component verdict.
* @remark The use of this function requires prior connection of
* the server sync ports!
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT
* @see LibCommon_Sync.f_serverSyncClientsTimed
* @see LibCommon_Sync.f_serverWaitForAllClientsToStop
* @param p_syncPointIds list of synchronization point name/ids
*/
function f_serverSync4ClientsAndStop( in SyncPointList p_syncPointIds )
runs on ServerSyncComp {
var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
f_serverSyncClientsTimed(4,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
}
f_serverWaitForAllClientsToStop();
}
/**
* @desc Implements synchronization of N clients from server side
* on one or more synchronization points.
* If problem occurs, then server sends STOP to all clients.
* Waits for PX_TSYNC_TIME_LIMIT to let clients
* finish executing their behavior until this
* synchronization point. After passing all synchronization
* points successfuly the server waits for all clients
* to stop.
* See f_serverSyncClientsTimed for overwriting this
* the timing constraint!
* This function sets the server component verdict.
* @remark The use of this function requires prior connection of
* the server sync ports!
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT
* @see LibCommon_Sync.f_serverSyncClientsTimed
* @see LibCommon_Sync.f_serverWaitForAllClientsToStop
* @param p_numClients number of synchronization clients
* @param p_syncPointIds list of synchronization point name/ids
*/
function f_serverSyncNClientsAndStop (
in integer p_numClients,
in SyncPointList p_syncPointIds )
runs on ServerSyncComp {
var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
f_serverSyncClientsTimed (
p_numClients,
p_syncPointIds[i],
PX_TSYNC_TIME_LIMIT );
}
f_serverWaitForAllClientsToStop();
}
/**
* @desc Implements synchronization of 2 clients and 1 UT from server side
* on one or more synchronization points.
* If problem occurs, then server sends STOP to all clients.
* Waits for PX_TSYNC_TIME_LIMIT to let clients
* finish executing their behavior until this
* synchronization point. After passing all synchronization
* points successfuly the server waits for all clients
* to stop.
* See f_serverSyncClientsTimed for overwriting this
* the timing constraint!
* This function sets the server component verdict.
* @remark The use of this function requires prior connection of
* the server sync ports!
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT
* @see LibCommon_Sync.f_serverSyncClientsTimed
* @see LibCommon_Sync.f_serverWaitForAllClientsToStop
* @param p_syncPointIds list of synchronization point name/ids
*/
function f_serverSync2ClientsUtAndStop( in SyncPointList p_syncPointIds )
runs on ServerSyncComp {
var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
f_serverSyncClientsTimed(3,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
}
f_serverWaitForAllClientsToStop();
}
/**
* @desc Calls either self synchronization function if
* invoking component is the MTC, otherwise
* calls client synchronization. After that it
* sets the verdict based on the specified return code.
* This function allows to implement TTCN-3 functions
* in a way that they can be used in both non-concurrent
* as well as concurrent test cases.
* @remark This function should _not_ be called if the MTC
* acts as a client (and not a server) in a concurrent
* test case. In this case f_clientSyncAndVerdict
* should be used instead.
* @param p_syncPoint Synchronization point name/id
* @param p_ret Current behavior execution status
* @see LibCommon_Sync.f_clientSyncAndVerdict
* @see LibCommon_VerdictControl.f_setVerdict
*/
function f_selfOrClientSyncAndVerdict( in charstring p_syncPoint,
in FncRetCode p_ret)
runs on SelfSyncComp {
if ( self == mtc ) {
// then assume we are running non-conurrent test case
f_selfSyncAndVerdict(p_syncPoint, p_ret);
} else {
f_clientSyncAndVerdict(p_syncPoint, p_ret);
}
}
/**
* @desc Calls either self synchronization function if
* invoking component is the MTC, otherwise
* calls client synchronization. After that it
* sets a preamble specific verdict based on the
* specified return code.
* This function allows to implement TTCN-3 functions
* in a way that they can be used in both non-concurrent
* as well as concurrent test cases.
* @remark This function should _not_ be called if the MTC
* acts as a client (and not a server) in a concurrent
* test case. In this case f_clientSyncAndVerdict
* should be used instead.
* @param p_syncPoint Synchronization point name/id
* @param p_ret Current behavior execution status
* @see LibCommon_Sync.f_clientSyncAndVerdict
* @see LibCommon_VerdictControl.f_setVerdictPreamble
*/
function f_selfOrClientSyncAndVerdictPR( in charstring p_syncPoint,
in FncRetCode p_ret)
runs on SelfSyncComp {
if ( self == mtc ) {
// then assume we are running non-conurrent test case
f_selfSyncAndVerdictPreamble(p_syncPoint, p_ret);
} else {
f_clientSyncAndVerdictPreamble(p_syncPoint, p_ret);
}
}
} // end group syncFunctions
group syncCompStateHandling {
/**
*
* @desc This function updates the state (stack) of a
* sync client or self sync component. This stack is
* key in the shutdown handling of test components.
* It adds the new state name to the top of the
* sync component stack of states.
* The state will only be added in case of a current
* execution status of e_success.
* @param p_newSyncCompState Name of state which was attempted to be reached.
* @param p_ret Current behavior execution status
* @remark If the state of component changes this function must be
* _at least_ called from your test suite prior to f_selfSync
* or f_clientSync which is the only definite place for the
* shutdown default invocation!
* @see LibCommon_Sync.a_dummyShutDown
* @see LibCommon_Sync.f_selfSync
* @see LibCommon_Sync.f_clientSync
*/
function f_addSyncCompState(in charstring p_newSyncCompState,
in FncRetCode p_ret)
runs on ClientSyncComp {
if ( p_ret == e_success ) {
if ( f_isItemOnStringStack(v_stateStack,p_newSyncCompState) ) {
log("**** f_addSyncCompState: WARNING: Attempt to add state which is already on sync state stack! No additition done.****");
} else {
f_pushStringStack(v_stateStack,p_newSyncCompState);
}
}
} // end function f_addSyncCompState
/**
*
* @desc This function returns the top state on the sync
* state stack of a sync client or self sync
* component and removes it from the stack
* This function cna be used, e.g., in a while
* statement within a postamble or shutdown
* implementation
* @param p_state State on top of the state stack.
* @return false if state stack is empty, true otherwise
* @see LibCommon_Sync.a_dummyShutDown
*/
function f_getTopSyncCompState( out charstring p_state )
runs on ClientSyncComp
return boolean {
if ( not f_peekStringStackTop(v_stateStack,p_state) ) {
p_state := "IDLE";
return false;
}
f_popStringStack(v_stateStack);
return true;
} // end function f_getTopSyncCompState
/*
* @desc This function removes the last state on the state stack
* of a sync client or self sync component.
* This stack is key in the shutdown handling of test
* components.
* @see LibCommon_Sync.a_dummyShutDown
*/
function f_popSyncCompState()
runs on ClientSyncComp {
f_popStringStack(v_stateStack);
} // end function f_popSyncCompState
/**
*
* @desc This function returns the top state on the sync state
* stack of a sync client or self sync component. It
* does not remove it from the stack
* This stack is key in the shutdown handling of test
* components.
* @param p_state State on top of the state stack.
* @return false if state stack is empty, true otherwise
* @see LibCommon_Sync.a_dummyShutDown
*/
function f_peekTopSyncCompState(out charstring p_state)
runs on ClientSyncComp
return boolean {
return f_peekStringStackTop(v_stateStack,p_state);
} // end function f_peekTopSyncCompState
/**
* @desc This function checks if the sync state stack
* of a sync client or self sync component is empty.
* This stack is key in the shutdown handling of test
* components.
* @see LibCommon_Sync.a_dummyShutDown
*/
function f_isSyncCompStateStackEmpty()
runs on ClientSyncComp
return boolean {
return f_isStringStackEmpty(v_stateStack);
} // end function f_isSyncCompStateStackEmpty
} // end group syncCompStateHandling
group exampleShutDownAltstep {
/**
* @desc This is an example of a shutdown altstep which can be
* used as a "template" for a interface specific shutdown
* altstep or possily as a first temporary solution in
* test case development.
* This altstep shall be activated as a default as the
* first statement in each test case function which drives
* an interface, i.e., in MTC behavior of single component
* and in each client behavior of multi component test
* cases.
* The required behavior from this altstep is to:
* 1) expect the STOP either via the test component
* syncPort
* 2) upon its arrival it should shut down the SUT
* gracefully based on the current component state
* The current component state should have been
* previously kept uptodate from a test suite via the
* f_addSyncCompState function. This default will then be
* (automatically) invoked either from within f_selfSync
* or f_clientSync.
* Note that shutdown defaults can be written as
* _interface specific_ - they do not need to be test case
* or test component specific! See another example of a
* shutdown altstep in the sync module.
* @see LibCommon_Sync.f_addSyncCompState
* @see LibCommon_Sync.f_selfSync
* @see LibCommon_Sync.f_clientSync
* @see LibCommon_SyncExamples.a_exampleShutDown
* @remark Your application specific shutdown altstep
* implementation(s) should _not_ be defined in this
* module but as part of your test suite or application specific
* modules.
*/
altstep a_dummyShutDown()
runs on SelfSyncComp {
[] syncPort.receive(m_syncServerStop){
var charstring v_state := "";
tc_sync.stop;
log("**** a_dummyShutDown: Test component received STOP signal from sync server - going to IDLE state ****");
while ( f_getTopSyncCompState(v_state) ) {
if ( v_state == "x" ) {
// then do something
} else if ( v_state == "y" ) {
// then do something else
}
} // end while
f_disconnect4SelfOrClientSync();
// unmap/disconnect more if needed
log("**** a_dummyShutDown: -> Test component stopping itself now! ****") ;
stop ;
}
} // end altstep a_dummyShutDown
} // end group exampleShutDownAltstep
} // end group basicUserRelevantDefinitions
group advancedUserRelevantDefinitions {
group serverRelated {
/**
* @desc Implements synchronization of "n" clients from server
* side. If a problem occurs, then server sends STOP to
* all clients. Waits for PX_TSYNC_TIME_LIMIT to let
* clients finish executing their behavior until this
* synchronization point. See f_serverSyncClientsTimed for
* overwriting this later timing constraint!
* This function sets the server component verdict.
* @remark The use of this function requires prior connection of
* the server sync port!
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT
* @see LibCommon_Sync.f_serverSyncClientsTimed
* @param p_noOfClients number of clients to be synchronized
* @param p_syncId synchronization point name/id
*/
function f_serverSyncClients( in UInt p_noOfClients, in charstring p_syncId )
runs on ServerSyncComp {
f_serverSyncClientsTimed(p_noOfClients,p_syncId, PX_TSYNC_TIME_LIMIT);
}
/**
* @desc Handles synchronization of clients from server side.
* If problem occurs, then server sends STOP to all clients.
* This function sets the server verdict.
* @remark The use of this function requires prior connection of
* the server sync ports!
* @param p_NoOfClients number of clients to be synchronized
* @param p_syncId synchronization point name/id
* @param p_execTimeLimit time limit given to all clients to finish the execution
* of their behavior up to this synchronization point
* @see LibCommon_Sync.f_connect4SelfOrClientSync
*/
function f_serverSyncClientsTimed( in UInt p_NoOfClients,
in charstring p_syncId,
float p_execTimeLimit )
runs on ServerSyncComp {
var integer v_noOfRecvdSyncMsgs := 0;
var boolean v_stopClients := false;
var ClientSyncCompList v_clientRefs := {};
var ClientSyncComp v_clientRef;
if ( p_syncId == c_prDone ) {
log("**** f_serverSyncClientsTimed: Sync server now starting PREAMBLE synchronization ... ****") ;
} else if ( p_syncId == c_tbDone ) {
log("**** f_serverSyncClientsTimed: Sync server now starting TEST BODY synchronization ... ****") ;
} else if ( p_syncId == c_initDone ) {
log("**** f_serverSyncClientsTimed: Sync server now starting UPPER TESTER synchronization ... ****") ;
} else {
log("**** f_serverSyncClientsTimed: Sync server now starting handling of next synchronization point ... ****") ;
}
tc_sync.start(p_execTimeLimit) ;
alt{
[] syncPort.receive(m_syncClientReady(p_syncId)) -> sender v_clientRef {
v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef;
v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1;
if ( v_noOfRecvdSyncMsgs != p_NoOfClients ) { repeat; }
}
[] syncPort.receive(m_syncClientStop) -> sender v_clientRef {
log("**** f_serverSyncClientsTimed: Sync server received STOP signal from a client - server will wait for all clients to reach their next synchronization point and then stop them! ****") ;
v_stopClients := true;
v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef;
v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1;
if ( v_noOfRecvdSyncMsgs != p_NoOfClients ) { repeat; }
}
[] syncPort.receive(m_syncClientReady(?)) -> sender v_clientRef {
log("**** f_serverSyncClientsTimed: Sync server received client sync message with incorrect synchronization point id which is currently not handled - server will stop all clients! ****") ;
v_stopClients := true;
v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; }
[] syncPort.receive(SyncCmd :? ) {
log("**** f_serverSyncClientsTimed: Sync server received (invalid) sync message from other sync server - server will stop all clients! ****") ;
v_stopClients := true; }
[] any port.receive {
// leave it to be ok to receive anything else
// in case that the user has added any non-sync ports to
// his/her server component type definition!
}
[] tc_sync.timeout{
log("**** f_serverSyncClientsTimed: A client is not responding within specified time limit - sync server is sending stop to all clients! ****");
v_stopClients := true; }
} //end alt
tc_sync.stop ;
if ( v_stopClients ) {
setverdict(inconc);
// then send out STOP sync msg
f_serverSendToAllClients(v_clientRefs, m_syncServerStop);
f_serverWaitForAllClientsToShutDown(); // function will never return!
} else {
setverdict(pass);
// then send out READY sync msg
f_serverSendToAllClients(v_clientRefs, m_syncServerReady(p_syncId));
if ( p_syncId == c_prDone ) {
log("**** f_serverSyncClientsTimed: Sync server successfully passed PREAMBLE synchronization point. ****") ;
} else if ( p_syncId == c_tbDone ) {
log("**** f_serverSyncClientsTimed: Sync server successfully passed TEST BODY synchronization point. ****") ;
} else {
log("**** f_serverSyncClientsTimed: Sync server successfully passed synchronization point. ****") ;
}
}
} // end function f_serverSyncClientsTimed
/**
* @desc This function is intended only for use on the sync
* server component in concurrent TTCN-3 test cases.
* It waits for all components to finish execution within
* the PX_TSYNC_TIME_LIMIT. If a timeout occurs
* the server will stop all clients.
* This function sets the server component verdict.
*/
function f_serverWaitForAllClientsToStop()
runs on ServerSyncComp {
tc_sync.start;
alt {
[] all component.done {
tc_sync.stop;
log("**** f_serverWaitForAllClientsToStop: All sync clients have finished their execution. Sync server now terminating test case. ****") ;
}
[] tc_sync.timeout {
log("**** f_serverWaitForAllClientsToStop: Not all sync clients have finshed execution within the sync time limit. Sync server will stop test case! ****") ;
}
} // end alt
setverdict(pass);
stop;
} // end function f_serverWaitForAllClientsToStop
} // end group serverRelated
group clientRelated {
/**
* @desc This function creates the connection needed to
* execute client synchronization functions
* @see LibCommon_Sync.f_clientSync
* @see LibCommon_Sync.f_clientSendStop
*/
function f_connect4ClientSync()
runs on ClientSyncComp {
connect(self:syncPort, mtc:syncPort);
}// end function f_connect4ClientSync
/**
* @desc This function removes the connection needed
* to execute client synchronization functions
* @see LibCommon_Sync.f_clientSync
* @see LibCommon_Sync.f_clientSendStop
*/
function f_disconnect4ClientSync()
runs on ClientSyncComp {
disconnect(self:syncPort, mtc:syncPort);
}// end function f_disconnect4ClientSync
/**
* @desc This function combines client verdict setting with its
* synchronization for use after or within a preamble
* implementation.
* Note that such preambles can _not_ be reused in non-
* concurrent test cases.
* This function sets the client component verdict.
* @remark The use of this function requires prior connection
* of the client sync port!
* @see LibCommon_Sync.f_connect4ClientSync
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_VerdictControl.f_setVerdictPreamble
* @param p_syncId Synchronization point name/id
* @param p_ret Current behavior execution status
*/
function f_clientSyncAndVerdictPreamble(in charstring p_syncId ,
FncRetCode p_ret )
runs on ClientSyncComp {
f_setVerdictPreamble(p_ret);
f_clientSync(p_syncId,p_ret);
}
/**
* @desc This function combines client verdict setting with its
* synchronization for use,e.g, after or within a
* test body implementation.
* Note that such premables can _not_ be reused in non-
* concurrent test cases. This can be achieved by using
* the f_selfOrClientSyncAndVerdict function instead.
* This function sets the client component verdict.
* @param p_syncId Synchronization point name/id
* @param p_ret Current behavior execution status
* @remark The use of this function requires prior connection
* of the client sync port!
* @see LibCommon_Sync.f_connect4ClientSync
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_VerdictControl.f_setVerdict
* @see LibCommon_Sync.f_selfOrClientSyncAndVerdict
*/
function f_clientSyncAndVerdict(in charstring p_syncId,
in FncRetCode p_ret )
runs on ClientSyncComp {
f_setVerdict(p_ret);
f_clientSync(p_syncId,p_ret);
}
/**
* @desc This function combines client verdict setting with its
* synchronization for use after or within a
* postamble implementation.
* Note that such prostambles can _not_ be reused in non-
* concurrent test cases.
* This function sets the client component verdict.
* @remark The use of this function requires prior connection
* of the client sync port!
* @see LibCommon_Sync.f_connect4ClientSync
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_VerdictControl.f_setVerdictPostamble
* @param p_syncId Synchronization point name/id
* @param p_ret Current behavior execution status
*/
function f_clientSyncAndVerdictPostamble(in charstring p_syncId ,
in FncRetCode p_ret )
runs on ClientSyncComp {
f_setVerdictPostamble(p_ret);
f_clientSync(p_syncId,p_ret);
}
/**
* @desc This function handles synchronization of a sync client
* with the server. In case of successful execution it sends
* a READY message to the server and waits the READY back.
* The time used for waiting is defined by PX_TSYNC_TIME_LIMIT.
* In case of a non successful execution status it
* sends a STOP message to the server.
* In both cases the receipt of a STOP message or no
* response from the server it will trigger the shutdown
* default (if activated).
* This function will set only the client verdict to INCONC
* (and stop its execution) if no STOP response is received
* from the server within the PX_TSYNC_TIME_LIMIT
* or if no shutdown default is activated. In all other
* cases the client verdict is NOT set.
* @param p_syncId Synchronization point name/id
* @param p_ret Current behavior execution status
* @remark The use of this function requires prior connection
* of the client sync port!
* @see LibCommon_Sync.f_connect4ClientSync
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT
* @see LibCommon_Sync.a_dummyShutDown
* @see LibCommon_Sync.f_clientSendStop
* @return Updated execution status
*/
function f_clientSync( in charstring p_syncId ,
in FncRetCode p_ret )
runs on ClientSyncComp
return FncRetCode{
if (p_ret == e_success){
syncPort.send(m_syncClientReady(p_syncId));
tc_sync.start;
alt{
[] syncPort.receive(m_syncServerReady(p_syncId)){
tc_sync.stop ; }
[] tc_sync.timeout{
log("**** f_clientSync: Sync client did not receive message from sync server within the specified time limit - sync client will ask sync server to stop test case! ****") ;
f_clientSendStop(); } // function will not return!
} //end alt
} //end if
else {
log("**** f_clientSync: Execution status indicates that execution of test component behavior was not successful - sync client will ask sync server to stop test case! ****") ;
f_clientSendStop(); // function will not return!
}
if ( p_syncId == c_prDone ) {
log("**** f_clientSync: Sync client successfully passed PREAMBLE synchronization point. ****") ;
} else if ( p_syncId == c_tbDone ) {
log("**** f_clientSync: Sync client successfully passed TEST BODY synchronization point. ****") ;
} else {
log("**** f_clientSync: Sync client successfully passed synchronization point. ****") ;
}
return e_success ;
} // end function f_clientSync
/**
* @desc This function can be used to request the shutdown a
* multi component test case _prior_ to reaching a
* synchronization point. It sends a STOP message to
* the sync server and awaits then the STOP from the server
* which will trigger the shutdown default (if activated).
* This function will set the server verdict to INCONC (and
* stop the test case) if no shutdown default is activated.
* This function will set only the client verdict to INCONC
* (and stop its execution) if no STOP response is received
* from the server within the PX_TSYNC_TIME_LIMIT
* or if no shutdown default is activated. In all other
* cases the client verdict is NOT set.
* @remark The use of this function requires prior connection
* of the client sync port!
* @see LibCommon_Sync.f_connect4ClientSync
* @see LibCommon_Sync.f_connect4SelfOrClientSync
* @see LibCommon_Sync.PX_TSYNC_TIME_LIMIT
* @see LibCommon_Sync.a_dummyShutDown
*/
function f_clientSendStop()
runs on ClientSyncComp {
log("**** f_clientSendStop: Sync client requesting from server to stop test case (including itself). ****") ;
syncPort.send(m_syncClientStop) ;
tc_sync.start;
alt{
[] tc_sync.timeout{
log("**** f_clientSendStop: Stopping sync client without shutdown - either no shutdown default active or no stop received from server. ****") ;
setverdict(inconc);
stop ;
}
}//end alt
tc_sync.stop;
stop; // stop here if shutdown default does not stop
}
} // end group clientRelated
} // end group advancedUserRelevantDefinitions
group otherSyncModuleDefinitions {
group syncModuleparams {
/**
*
* @desc Default time limit for a sync client to reach a
* synchronization point
*/
modulepar {float PX_TSYNC_TIME_LIMIT := 120.0}
/*
* @desc Default time limit for a sync client to finish
* its execution of the shutdown default
*/
modulepar {float PX_TSHUT_DOWN_TIME_LIMIT := 120.0}
}
group otherSyncTypes {
type record of charstring SyncPointList;
type record of ClientSyncComp ClientSyncCompList;
} // end group otherSyncTypes
group otherSelfSyncRelatedDefinitions {
/**
* @desc This function creates the connection needed to
* execute self sync functions
* @see LibCommon_Sync.f_selfSync
* @see LibCommon_Sync.f_selfSyncStop
*/
function f_connect4SelfSync()
runs on SelfSyncComp {
connect(self:syncSendPort, self:syncPort);
}// end function f_connect4SelfSync
/**
* @desc This function removes the connection needed
* to execute self sync functions
* @see LibCommon_Sync.f_selfSync
* @see LibCommon_Sync.f_selfSyncStop
*/
function f_disconnect4SelfSync()
runs on SelfSyncComp {
disconnect(self:syncSendPort, self:syncPort);
}// end function f_disconnect4SelfSync
/**
* @desc This function combines MTC verdict setting with self
* synchronization for use after and possibly in the test body
* @param p_syncId Synchronization point name/id
* @param p_ret Current behavior execution status
* @see LibCommon_VerdictControl.f_setVerdict
* @see LibCommon_Sync.f_selfSync
* @see LibCommon_Sync.a_dummyShutDown
*/
function f_selfSyncAndVerdict( in charstring p_syncId,
in FncRetCode p_ret )
runs on SelfSyncComp {
f_setVerdict(p_ret);
f_selfSync(p_syncId,p_ret);
}
/**
* @desc This function combines MTC verdict setting with self
* synchronization for use after the preamble.
* @param p_syncId Synchronization point name/id
* @param p_ret Current behavior execution status
* @see LibCommon_VerdictControl.f_setVerdictPreamble
* @see LibCommon_Sync.f_selfSync
*/
function f_selfSyncAndVerdictPreamble( in charstring p_syncId,
in FncRetCode p_ret )
runs on SelfSyncComp {
f_setVerdictPreamble(p_ret);
f_selfSync(p_syncId,p_ret);
}
/**
* @desc This function combines MTC verdict setting with self
* synchronization for use after the postamble.
* @param p_syncId Synchronization point name/id
* @param p_ret Current behavior execution status
* @see LibCommon_VerdictControl.f_setVerdictPostamble
* @see LibCommon_Sync.f_selfSync
*/
function f_selfSyncAndVerdictPostamble( in charstring p_syncId ,
in FncRetCode p_ret )
runs on SelfSyncComp {
f_setVerdictPostamble(p_ret);
f_selfSync(p_syncId,p_ret);
}
/**
* @desc This function synchronizes a MTC with itself. In case
* of a non successful execution status it sends a STOP
* message to itself and invokes that way the
* shutdown default (if activated).
* This function will set the server verdict to INCONC (and
* stop the test case) if no shutdown default is activated.
* Otherwise no verdict is set.
* @remark Sync ports should be connected prior to the invocation
* of this function!
* @param p_syncId Synchronization point name/id
* @param p_ret Current behavior execution status
* @return Updated execution status
* @see LibCommon_Sync.f_connect4SelfSync
* @see LibCommon_Sync.a_dummyShutDown
*/
function f_selfSync( in charstring p_syncId ,
in FncRetCode p_ret )
runs on SelfSyncComp
return FncRetCode{
if (p_ret != e_success){
f_selfSyncStop() ; // function will not return!
}
if ( p_syncId == c_prDone ) {
log("**** f_selfSync: Successfully passed PREAMBLE synchronization point. ****") ;
} else if ( p_syncId == c_tbDone ) {
log("**** f_selfSync: Successfully passed TEST BODY synchronization point. ****") ;
} else {
log("**** f_selfSync: Successfully passed synchronization point. ****") ;
}
return e_success ;
}// end function f_selfSync
/**
* @desc This function can be used to shut down a test case _prior_
* to reaching a synchronization point. it sends a STOP
* message to itself and invokes that way the
* shutdown default (if activated).
* This function will set the server verdict to INCONC (and
* stop the test case) if no shutdown default is activated.
* Otherwise no verdict is set.
* @remark Sync ports should be connected prior to the invocation
* of this function!
* @see LibCommon_Sync.f_connect4SelfSync
*/
function f_selfSyncStop()
runs on SelfSyncComp {
log("**** f_selfSyncStop: MTC requests to stop test case (itself). ****") ;
syncSendPort.send(m_syncServerStop) ; // this MUST be _server_ for the default to catch!
tc_sync.start(PX_TSYNC_TIME_LIMIT);
alt{
[] tc_sync.timeout{
log("**** f_selfSyncStop: Stopping MTC without shutdown - either no shutdown default active or missing syncPort connection ****") ;
setverdict(inconc);
stop ;
}
}//end alt
tc_sync.stop;
stop; // if shutdown default is not activated or if it does not stop
} // end function f_selfSyncStop
} // end group otherSelfSyncRelatedDefinitions
/**
*
* @desc The sychronization protocol is conceptually based on
* named synchronization. Each synchronization point
* has it own specific synchronization message. This
* makes each synchronization unique, and allows, e.g., to
* ensure that a server synchronizes only clients which have
* reached the same synchronization point.
*/
group syncProtocolDefinition {
type union SyncCmd {
ClientReady clientReady,
ServerReady serverReady,
ClientStop clientStop,
ServerStop serverStop
}
type record ClientReady {
charstring syncPointId
}
type record ServerReady {
charstring syncPointId
}
type record ClientStop {}
type record ServerStop {}
} // end group syncProtocolDefinition
group syncMessages {
template SyncCmd m_syncClientReady( template charstring p_syncId ) := {
clientReady := { p_syncId }
}
template SyncCmd m_syncServerReady( template charstring p_syncId ) := {
serverReady := { p_syncId }
}
template SyncCmd m_syncClientStop := {
clientStop := {}
}
template SyncCmd m_syncServerStop := {
serverStop := {}
}
} // end group syncMessages
group otherSyncFunctions {
/**
* @desc Makes server send a sync message to all known clients
* @param p_clientRefs List of client references to which the message is to be send
* @param p_syncCmd The actual synchronization message to be sent out
*/
function f_serverSendToAllClients( in ClientSyncCompList p_clientRefs,
in template SyncCmd p_syncCmd)
runs on ServerSyncComp {
var integer i:=0;
for (i:=0; i< sizeof(p_clientRefs); i:=i+1 ){
syncPort.send(p_syncCmd) to p_clientRefs[i];
}
} // end function f_serverSendToAllClients
/**
* @desc This function is intended only for use on server in concurrent
* TTCN-3 test cases. It waits for all components to shut down
* within the PX_TSHUT_DOWN_TIME_LIMIT. If a timeout occurs
* it aborts the test case (no matter how far clients got with their
* shutdown).
* This function sets the server verdict.
*/
function f_serverWaitForAllClientsToShutDown()
runs on ServerSyncComp {
tc_shutDown.start(PX_TSHUT_DOWN_TIME_LIMIT);
alt {
[] all component.done {
tc_shutDown.stop;
log("**** f_serverWaitForAllClientsToShutDown: All components have properly shut down. Sync server will now terminate the test case. ****") ;
}
[] tc_shutDown.timeout {
log("**** f_serverWaitForAllClientsToShutDown: Not all clients have properly shutdown within the shut down time limit. Sync server will now terminate test case! ****") ;
}
} // end alt
// cover case that shut down default is NOT activated
setverdict(inconc);
mtc.stop;
} // end function f_serverWaitForAllClientsToShutDown
} // end group otherSyncFunctions
} // end group otherSyncDefinitions
} // end module LibCommon_Sync
LibCommon-v1.3.0@25/LibCommon_TextStrings.ttcn 0000664 0000000 0000000 00000012723 11214173474 0021167 0 ustar 00root root 0000000 0000000 /**
* @author ETSI
* @version $URL$
* $Id$
* @desc A collection of text string type and value definitions which
* may be useful in the implementation of any TTCN-3 test
* suite. "Text string" refers to TTCN-3 charstring and universal
* charstring types.
* @remark End users should be aware that any changes made to the in
* definitions this module may be overwritten in future releases.
* End users are encouraged to contact the distributers of this
* module regarding their modifications or additions so that future
* updates will include your changes.
*/
module LibCommon_TextStrings {
/**
* @desc These constants can be used to add special characters into
* TTCN-3 text strings by using the concatenation operator.
* Example use:
* var charstring v_text := "Hi!" & c_CRLF & "Hello!";
*/
group usefulConstants {
const charstring c_NUL := oct2char('00'O);
const charstring c_SOH := oct2char('01'O);
const charstring c_STX := oct2char('02'O);
const charstring c_ETX := oct2char('03'O);
const charstring c_EOT := oct2char('04'O);
const charstring c_ENQ := oct2char('05'O);
const charstring c_ACK := oct2char('06'O);
const charstring c_BEL := oct2char('07'O);
const charstring c_BS := oct2char('08'O);
const charstring c_TAB := oct2char('09'O);
const charstring c_LF := oct2char('0A'O);
const charstring c_VT := oct2char('0B'O);
const charstring c_FF := oct2char('0C'O);
const charstring c_CR := oct2char('0D'O);
const charstring c_SO := oct2char('0E'O);
const charstring c_SI := oct2char('0F'O);
const charstring c_DLE := oct2char('10'O);
const charstring c_DC1 := oct2char('11'O);
const charstring c_DC2 := oct2char('12'O);
const charstring c_DC3 := oct2char('13'O);
const charstring c_DC4 := oct2char('14'O);
const charstring c_NAK := oct2char('15'O);
const charstring c_SYN := oct2char('16'O);
const charstring c_ETB := oct2char('17'O);
const charstring c_CAN := oct2char('18'O);
const charstring c_EM := oct2char('19'O);
const charstring c_SUB := oct2char('1A'O);
const charstring c_ESC := oct2char('1B'O);
const charstring c_FS := oct2char('1C'O);
const charstring c_GS := oct2char('1D'O);
const charstring c_RS := oct2char('1E'O);
const charstring c_US := oct2char('1F'O);
const charstring c_DEL := oct2char('7F'O);
const charstring c_CRLF := oct2char('0D'O) & oct2char('0A'O);
} // end group usefulConstants
/**
* @remark Number in name indicates string length in number of
* _characters_
*/
group textStringSubTypes {
type charstring String1 length(1) with { encode "length(1)"};
type charstring String2 length(2) with { encode "length(2)"};
type charstring String3 length(3) with { encode "length(3)"};
type charstring String4 length(4) with { encode "length(4)"};
type charstring String5 length(5) with { encode "length(5)"};
type charstring String6 length(6) with { encode "length(6)"};
type charstring String7 length(7) with { encode "length(7)"};
type charstring String8 length(8) with { encode "length(8)"};
type charstring String9 length(9) with { encode "length(9)"};
type charstring String10 length(10) with { encode "length(10)"};
type charstring String11 length(11) with { encode "length(11)"};
type charstring String12 length(12) with { encode "length(12)"};
type charstring String13 length(13) with { encode "length(13)"};
type charstring String14 length(14) with { encode "length(14)"};
type charstring String15 length(15) with { encode "length(15)"};
type charstring String16 length(16) with { encode "length(16)"};
type charstring String1To13 length(1..13) with {encode "length(1..13)"};
type charstring String1To63 length(1..63) with {encode "length(1..63)"};
type charstring String1To64 length(1..64) with {encode "length(1..64)"};
type charstring String1To127 length(1..127) with {encode "length(1..127)"};
type charstring String1To128 length(1..128) with {encode "length(1..128)"};
type charstring String1to255 length(1..255) with {encode "length(1..255)"};
type charstring String5to253 length (5..253) with {encode "length(5..253)"};
} // end stringSubTypes
group usefulTextStringTypes {
type universal charstring UnicodeText;
type universal charstring UnicodeText1to255 length(1..255)
with {encode "length(1..255)"};
/**
* @desc Subtyping can not be used in this type definition to ensure
* values of this type are really alphanumeric.
* Instead either codecs or a template have
* to be used for this purpose. The type is kept here to ensure
* backward compatibility.
* @see LibCommon_TextStrings.mw_isAlphaNum
*/
type charstring AlphaNum with { encode "alphanumeric"};
type AlphaNum AlphaNum2 length(2) with { encode "alphanumeric;length(2)"};
type AlphaNum AlphaNum1To32 length(1..32) with {encode "alphanumeric;length(1..32)"};
} // end group usefulTextStringTypes
group usefulTextStringTemplates {
template charstring mw_isAlphaNum := pattern "([0-9]|[a-z]|[A-Z])+";
} // end group usefulTextStringTemplates
} // end module LibCommon_TextStrings
LibCommon-v1.3.0@25/LibCommon_Time.ttcn 0000664 0000000 0000000 00000005155 11214173474 0017570 0 ustar 00root root 0000000 0000000 /**
* @author ETSI
* @version $URL$
* $Id$
* @desc A collection of time handling functions which may be useful in
* the implementation of any TTCN-3 test suite.
* @remark End users should be aware that any changes made to the in
* definitions this module may be overwritten in future releases.
* End users are encouraged to contact the distributers of this
* module regarding their modifications or additions so that future
* updates will include your changes.
*/
module LibCommon_Time {
group timeLibModuleParameters {
/**
* @desc Time to control PTC.stop
* @remark PICS/PIXIT Reference: XXX
*/
modulepar {float PX_TDONE := 120.0}
/**
* @desc Time to control the reception of a message
* @remark PICS/PIXIT Reference: XXX
*/
modulepar {float PX_TAC := 30.0}
/**
* @desc Time to control that IUT sends nothing
* @remark PICS/PIXIT Reference: XXX
*/
modulepar {float PX_TNOAC := 10.0}
/**
* @desc Time to control that IUT reacts prior to Upper Tester action
* @remark PICS/PIXIT Reference: XXX
*/
modulepar {float PX_TWAIT := 120.0}
/**
* @desc Time to control sending in loops
* @remark PICS/PIXIT Reference: XXX
*/
modulepar {float PX_LOOP := 1.0}
} // end group timeLibModuleParameters
group sleeping {
/**
* @desc The invocation of this function will cause a test component
* to sleep (or wait) for a specified amount of time.
* Defaults may interrupt this sleep if activated.
* @see LibCommon_Time.f_sleepIgnoreDef
* @param p_duration Amount of time that the test component should wait.
*/
function f_sleep ( in float p_duration ) {
timer t;
if (p_duration <= 0.0) {return}
t.start( p_duration );
t.timeout;
}
/**
* @desc The invocation of this function will cause a test component
* to sleep (or wait) for a specified amount of time.
* This function ignores any active defaults, i.e., the function
* will always wait the specified amount of time.
* @param p_duration Amount of time that the test component should wait.
*/
function f_sleepIgnoreDef ( in float p_duration ) {
timer t;
if (p_duration <= 0.0) {return}
t.start( p_duration );
alt {
[] t.timeout {}
[else] {repeat}
} // end alt
}
} // end group sleeping
} // end module LibCommon_Time
LibCommon-v1.3.0@25/LibCommon_VerdictControl.ttcn 0000664 0000000 0000000 00000006745 11214173474 0021641 0 ustar 00root root 0000000 0000000 /**
* @author ETSI
* @version $URL$
* $Id$
* @desc Contains generic functions which set test component verdicts
* based on generic function return codes according to established
* test implementation practice. These functions should only be called
* from test case functions (see reusable t3 code methodology) only.
* @remark End users should be aware that any changes made to the in
* definitions this module may be overwritten in future releases.
* End users are encouraged to contact the distributers of this
* module regarding their modifications or additions so that future
* updates will include your changes.
*/
module LibCommon_VerdictControl {
/**
* @desc Collection of all possible function return codes.
* This type should be used as a return parameter type
* in all TTCN-3 function definitions (except for
* functions invoked from in TTCN-3 start statements).
* This return value should be used to communicate a
* verdict to the caller _instead of_ literally setting
* a verdict in the function! This warrants a higher
* degree of reuse for the function.
*/
type enumerated FncRetCode {
e_success(0),
// error codes
e_error(1),
e_timeout(2)
}
/**
* @desc This function should be used for verdict
* setting after completion of, e.g., the test body
* execution.
* Sets verdicts are INCONC in case of a timeout, FAIL
* in case of an error, and PASS otherwise.
* @param p_ret Current execution status
*/
function f_setVerdict ( FncRetCode p_ret ) {
if ( p_ret == e_success ) {
setverdict(pass);
} else if ( p_ret == e_timeout ) {
setverdict(inconc);
} else {
setverdict(fail);
}
} // end function f_setVerdict
/**
* @desc This function should be used for verdict
* setting after completion of a preamble
* execution.
* Sets verdicts are INCONC in case of a timeout or
* an error, and PASS otherwise.
* @param p_ret Preamble execution status
*/
function f_setVerdictPreamble ( FncRetCode p_ret ) {
log("f_setVerdictPreamble: This function is deprecated. Use f_setVerdictPreOrPostamble instead. ");
f_setVerdictPreOrPostamble(p_ret);
} // end function f_setVerdictPreamble
/**
* @desc This function should be used for verdict
* setting after completion of a postamble
* execution.
* Sets verdicts are INCONC in case of a timeout or
* an error, and PASS otherwise.
* @param p_ret Postamble execution status
*/
function f_setVerdictPostamble ( FncRetCode p_ret ) {
log("f_setVerdictPostamble: This function is deprecated. Use f_setVerdictPreOrPostamble instead. ");
f_setVerdictPreOrPostamble(p_ret);
} // end function f_setVerdictPostamble
/**
* @desc This function should be used for verdict
* setting outside the test body.
* Sets verdicts are INCONC in case of a timeout or
* an error, and PASS otherwise.
* @param p_ret Postamble execution status
*/
function f_setVerdictPreOrPostamble ( FncRetCode p_ret ) {
if ( p_ret != e_success ) {
setverdict(inconc);
} else {
setverdict(pass);
}
} // end function f_setVerdictPreOrPostamble
} // end module LibCommon_VerdictControl