Commit da685728 authored by nikolajev's avatar nikolajev
Browse files

MSRP .DAT testing files, adapter, sources and solution for TestCast

parent 7830a76a
Loading
Loading
Loading
Loading
+132 −0
Original line number Diff line number Diff line
/** 
 *  @author   ETSI
 *  @version  $URL: svn+ssh://vcs.etsi.org/TTCN3/LIB/LibCommon/tags/v1.3.0/ttcn/LibCommon_AbstractData.ttcn $
 *            $Id: LibCommon_AbstractData.ttcn 40 2010-08-31 12:05:08Z mullers $
 *  @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
+224 −207
Original line number Diff line number Diff line
/*
 *	@author 	STF 276
 *  @version 	$Id$
/**
 *  @author   ETSI
 *  @version  $URL: svn+ssh://vcs.etsi.org/TTCN3/LIB/LibCommon/tags/v1.3.0/ttcn/LibCommon_BasicTypesAndValues.ttcn $
 *            $Id: LibCommon_BasicTypesAndValues.ttcn 40 2010-08-31 12:05:08Z mullers $
 *  @desc     A collection of basic type and value definitions which may be 
 *            useful in the implementation of any TTCN-3 test suite. <br><br>
 *  @remark   End users should be aware that any changes made to the  in
@@ -11,7 +12,7 @@
 */
 module LibCommon_BasicTypesAndValues {
  
	/* 
  /** 
   *  @remark Number in subtype name always indicates encoding length 
   *          in _bits_
   */
@@ -49,51 +50,50 @@
    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_uInt48Max := 2147483647;
    const integer c_uInt52Max := 4503599627370495;

    type integer  UInt  (0 .. infinity);
		type integer	UInt1 (0 .. c_uInt1Max) with {encode "length=1;"};
		type integer	UInt2 (0 .. c_uInt2Max) with {encode "length=2"};
		type integer	UInt3 (0 .. c_uInt3Max) with {encode "length=3"};
		type integer	UInt4 (0 .. c_uInt4Max) with {encode "length=4"};
		type integer	UInt5 (0 .. c_uInt5Max) with {encode "length=5"};
		type integer	UInt6 (0 .. c_uInt6Max) with {encode "length=6"};
		type integer	UInt7 (0 .. c_uInt7Max) with {encode "length=7"};
		type integer	UInt8 (0 .. c_uInt8Max) with {encode "length=8"};
		type integer	UInt9 (0 .. c_uInt9Max) with {encode "length=9"};
		type integer	UInt10 (0 .. c_uInt10Max) with {encode "length=10"};
		type integer	UInt11 (0 .. c_uInt11Max) with {encode "length=11"};
		type integer	UInt12 (0 .. c_uInt12Max) with {encode "length=12"};
		type integer	UInt13 (0 .. c_uInt13Max) with {encode "length=13"};
		type integer	UInt14 (0 .. c_uInt14Max) with {encode "length=14"};
    	type integer 	UInt15 (0 .. c_uInt15Max) with {encode "length=15"};
		type integer	UInt16 (0 .. c_uInt16Max) with {encode "length=16"};
		type integer	UInt17 (0 .. c_uInt17Max) with {encode "length=17"};
		type integer	UInt18 (0 .. c_uInt18Max) with {encode "length=18"};
		type integer	UInt19 (0 .. c_uInt19Max) with {encode "length=19"};
		type integer 	UInt20 (0 .. c_uInt20Max) with {encode "length=20"};
		type integer 	UInt21 (0 .. c_uInt21Max) with {encode "length=21"};
		type integer 	UInt22 (0 .. c_uInt22Max) with {encode "length=22"};
		type integer 	UInt23 (0 .. c_uInt23Max) with {encode "length=23"};
		type integer 	UInt24 (0 .. c_uInt24Max) with {encode "length=24"};
		type integer 	UInt25 (0 .. c_uInt25Max) with {encode "length=25"};
		type integer 	UInt26 (0 .. c_uInt26Max) with {encode "length=26"};
		type integer 	UInt27 (0 .. c_uInt27Max) with {encode "length=27"};
		type integer 	UInt28 (0 .. c_uInt28Max) with {encode "length=28"};
		type integer 	UInt29 (0 .. c_uInt29Max) with {encode "length=29"};
		type integer 	UInt30 (0 .. c_uInt30Max) with {encode "length=30"};
		type integer 	UInt31 (0 .. c_uInt31Max) with {encode "length=31"};
		type integer 	UInt32 (0 .. c_uInt32Max) with {encode "length=32"};
//		type integer 	UInt32 (0 .. c_uInt31Max) with {encode "length=32"};

		type integer 	UInt48 (0 .. c_uInt48Max) with {encode "length=48"};
//		type integer 	UInt48 (0 .. c_uInt31Max) with {encode "length=32"};
    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_
   */
@@ -165,55 +165,72 @@
    const integer c_int32Max := 2147483647;

    type integer  Int;
		type integer    Int1  (c_int1Min .. c_int1Max) with { encode "length=1"};
		type integer    Int2  (c_int2Min .. c_int2Max) with { encode "length=2"};
		type integer    Int3  (c_int3Min .. c_int3Max) with { encode "length=3"};
		type integer    Int4  (c_int4Min .. c_int4Max) with { encode "length=4"};
		type integer    Int5  (c_int5Min .. c_int5Max) with { encode "length=5"};
		type integer    Int6  (c_int6Min .. c_int6Max) with { encode "length=6"};
		type integer    Int7  (c_int7Min .. c_int7Max) with { encode "length=7"};
		type integer    Int8  (c_int8Min .. c_int8Max) with { encode "length=8"};
		type integer    Int9  (c_int9Min .. c_int9Max) with { encode "length=9"};
		type integer    Int10  (c_int10Min .. c_int10Max) with { encode "length=10"};
		type integer    Int11  (c_int11Min .. c_int11Max) with { encode "length=11"};
		type integer    Int12  (c_int12Min .. c_int12Max) with { encode "length=12"};
		type integer    Int13  (c_int13Min .. c_int13Max) with { encode "length=13"};
		type integer    Int14  (c_int14Min .. c_int14Max) with { encode "length=14"};
		type integer    Int15  (c_int15Min .. c_int15Max) with { encode "length=15"};
		type integer    Int16  (c_int16Min .. c_int16Max) with { encode "length=16"};
		type integer    Int17  (c_int17Min .. c_int17Max) with { encode "length=17"};
		type integer    Int18  (c_int18Min .. c_int18Max) with { encode "length=18"};
		type integer    Int19  (c_int19Min .. c_int19Max) with { encode "length=19"};
		type integer    Int20  (c_int20Min .. c_int20Max) with { encode "length=20"};
		type integer    Int21  (c_int21Min .. c_int21Max) with { encode "length=21"};
		type integer    Int22  (c_int22Min .. c_int22Max) with { encode "length=22"};
		type integer    Int23  (c_int23Min .. c_int23Max) with { encode "length=23"};
		type integer    Int24  (c_int24Min .. c_int24Max) with { encode "length=24"};
		type integer    Int25  (c_int25Min .. c_int25Max) with { encode "length=25"};
		type integer    Int26  (c_int26Min .. c_int26Max) with { encode "length=26"};
		type integer    Int27  (c_int27Min .. c_int27Max) with { encode "length=27"};
		type integer    Int28  (c_int28Min .. c_int28Max) with { encode "length=28"};
		type integer    Int29  (c_int29Min .. c_int29Max) with { encode "length=29"};
		type integer    Int30  (c_int30Min .. c_int30Max) with { encode "length=30"};
		type integer    Int31  (c_int31Min .. c_int31Max) with { encode "length=31"};
//		type integer    Int32  (c_int32Min .. c_int32Max) with { encode "length=32"};
    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 {encode "length=1"};
		type boolean	Bool2 with {encode "length=2"};
		type boolean	Bool3 with {encode "length=3"};
		type boolean	Bool4 with {encode "length=4"};
		type boolean	Bool5 with {encode "length=5"};
		type boolean	Bool6 with {encode "length=6"};
		type boolean	Bool7 with {encode "length=7"};
		type boolean	Bool8 with {encode "length=8"};
    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

+148 −98

File changed.

Preview size limit exceeded, changes collapsed.

+1165 −0

File added.

Preview size limit exceeded, changes collapsed.

+120 −105

File changed.

Preview size limit exceeded, changes collapsed.

Loading