Commit 2049b746 authored by filatov's avatar filatov
Browse files

merge branch v1.3.0_ItsCleanup@42 to the trunk

parent ec2836bb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -94,7 +94,7 @@
        p_item := "f_peekTopStringStack: String stack is empty!";
        p_item := "f_peekTopStringStack: String stack is empty!";
        return false;
        return false;
      }
      }
      p_item := p_stack.stringItems[p_stack.stackSize-1];
      p_item := valueof(p_stack.stringItems[p_stack.stackSize-1]);
      return true;
      return true;
    }
    }


+3 −0
Original line number Original line Diff line number Diff line
@@ -210,10 +210,13 @@
    const UInt6   c_uInt6Zero := 0;
    const UInt6   c_uInt6Zero := 0;
    const UInt7   c_uInt7Zero := 0;
    const UInt7   c_uInt7Zero := 0;
    const UInt8   c_uInt8Zero := 0;
    const UInt8   c_uInt8Zero := 0;
    const UInt10  c_uInt10Zero := 0;
    const UInt12  c_uInt12Zero := 0;
    const UInt12  c_uInt12Zero := 0;
    const UInt14  c_uInt14Zero := 0;
    const UInt14  c_uInt14Zero := 0;
    const UInt16  c_uInt16Zero := 0;
    const UInt16  c_uInt16Zero := 0;
    const UInt24  c_uInt24Zero := 0;
    const UInt32  c_uInt32Zero := 0;
    const UInt32  c_uInt32Zero := 0;
    const UInt48  c_uInt48Zero := 0;
    
    
  }//end group zeroedInt
  }//end group zeroedInt


+248 −64
Original line number Original line Diff line number Diff line
@@ -95,12 +95,9 @@ module LibCommon_Sync {
         *        component type is type compatible to this component
         *        component type is type compatible to this component
         *        type definition!
         *        type definition!
         */
         */
        type component ServerSyncComp {
        type component ServerSyncComp extends BaseSyncComp {
          timer tc_shutDown := PX_TSHUT_DOWN_TIME_LIMIT;
          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
         * @desc  This type is used to define any synchronization
@@ -114,12 +111,10 @@ module LibCommon_Sync {
         *        component type is type compatible to this component
         *        component type is type compatible to this component
         *        type definition!
         *        type definition!
         */
         */
        type component ClientSyncComp {
        type component ClientSyncComp extends BaseSyncComp {
          var StringStack v_stateStack:= c_initStringStack;
          var StringStack v_stateStack:= c_initStringStack;
          // definitions for BaseSyncComp
          var TestcaseStep vc_testcaseStep := e_preamble;
          port  SyncPort syncPort;
        }
          timer tc_sync := PX_TSYNC_TIME_LIMIT;
        } with { extension "extends BaseSyncComp" }


        /**
        /**
         * @desc  This type is used to define any synchronization
         * @desc  This type is used to define any synchronization
@@ -135,13 +130,9 @@ module LibCommon_Sync {
         *        component test cases!
         *        component test cases!
         * @see   LibCommon_Sync.ClientSyncComp
         * @see   LibCommon_Sync.ClientSyncComp
         */
         */
        type component SelfSyncComp {
        type component SelfSyncComp extends ClientSyncComp {
          port SyncPort syncSendPort;
          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
         * @desc  This port type must be imported into test suites
@@ -154,6 +145,16 @@ module LibCommon_Sync {
         */
         */
        type port SyncPort message { inout SyncCmd }
        type port SyncPort message { inout SyncCmd }



        /**
         * @desc Describes in which step of execution is the testcase
         */
        type enumerated TestcaseStep {
            e_preamble,
            e_testBody,
            e_postamble
        }
        
      } // end compTypeRelated
      } // end compTypeRelated


      group standardSyncPointNames {
      group standardSyncPointNames {
@@ -238,11 +239,7 @@ module LibCommon_Sync {
       */
       */
      function f_serverSync2ClientsAndStop( in SyncPointList p_syncPointIds )
      function f_serverSync2ClientsAndStop( in SyncPointList p_syncPointIds )
      runs on ServerSyncComp {
      runs on ServerSyncComp {
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
          f_serverSyncNClientsAndStop(2, p_syncPointIds);
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
          f_serverSyncClientsTimed(2,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
        }
        f_serverWaitForAllClientsToStop();
      }
      }


      /**
      /**
@@ -267,11 +264,7 @@ module LibCommon_Sync {
       */
       */
      function f_serverSync3ClientsAndStop( in SyncPointList p_syncPointIds )
      function f_serverSync3ClientsAndStop( in SyncPointList p_syncPointIds )
      runs on ServerSyncComp {
      runs on ServerSyncComp {
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
          f_serverSyncNClientsAndStop(3, p_syncPointIds);
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
          f_serverSyncClientsTimed(3,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
        }
        f_serverWaitForAllClientsToStop();
      }
      }


      /**
      /**
@@ -296,11 +289,7 @@ module LibCommon_Sync {
       */
       */
      function f_serverSync4ClientsAndStop( in SyncPointList p_syncPointIds )
      function f_serverSync4ClientsAndStop( in SyncPointList p_syncPointIds )
      runs on ServerSyncComp {
      runs on ServerSyncComp {
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
          f_serverSyncNClientsAndStop(4, p_syncPointIds);
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
          f_serverSyncClientsTimed(4,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
        }
        f_serverWaitForAllClientsToStop();
      }
      }


      /**
      /**
@@ -325,14 +314,14 @@ module LibCommon_Sync {
       * @param  p_syncPointIds list of synchronization point name/ids
       * @param  p_syncPointIds list of synchronization point name/ids
       */
       */
      function f_serverSyncNClientsAndStop ( 
      function f_serverSyncNClientsAndStop ( 
      	in integer p_numClients,
      	in UInt p_numClients,
      	in SyncPointList p_syncPointIds )
      	in SyncPointList p_syncPointIds )
      runs on ServerSyncComp {
      runs on ServerSyncComp {
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
          f_serverSyncClientsTimed (
          f_serverSyncClientsTimed (
          	p_numClients,
          	p_numClients,
          	p_syncPointIds[i],
          	valueof(p_syncPointIds[i]),
          	PX_TSYNC_TIME_LIMIT );
          	PX_TSYNC_TIME_LIMIT );
        }
        }
        f_serverWaitForAllClientsToStop();
        f_serverWaitForAllClientsToStop();
@@ -362,7 +351,7 @@ module LibCommon_Sync {
      runs on ServerSyncComp {
      runs on ServerSyncComp {
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
          f_serverSyncClientsTimed(3,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
          f_serverSyncClientsTimed(3,valueof(p_syncPointIds[i]), PX_TSYNC_TIME_LIMIT);
        }
        }
        f_serverWaitForAllClientsToStop();
        f_serverWaitForAllClientsToStop();
      }
      }
@@ -406,14 +395,14 @@ module LibCommon_Sync {
       *         as well as concurrent test cases.
       *         as well as concurrent test cases.
       * @remark This function should _not_ be called if the MTC
       * @remark This function should _not_ be called if the MTC
       *         acts as a client (and not a server) in a concurrent
       *         acts as a client (and not a server) in a concurrent
       *         test case. In this case f_clientSyncAndVerdict
       *         test case. In this case f_clientSyncAndVerdictPreamble
       *         should be used instead.
       *         should be used instead.
       * @param  p_syncPoint Synchronization point name/id
       * @param  p_syncPoint Synchronization point name/id
       * @param  p_ret Current behavior execution status
       * @param  p_ret Current behavior execution status
       * @see    LibCommon_Sync.f_clientSyncAndVerdict
       * @see    LibCommon_Sync.f_clientSyncAndVerdict
       * @see    LibCommon_VerdictControl.f_setVerdictPreamble
       * @see    LibCommon_VerdictControl.f_setVerdictPreamble
       */
       */
      function f_selfOrClientSyncAndVerdictPR( in charstring p_syncPoint,
      function f_selfOrClientSyncAndVerdictPreamble( in charstring p_syncPoint,
                             in FncRetCode p_ret)
                             in FncRetCode p_ret)
      runs on SelfSyncComp {
      runs on SelfSyncComp {
        if ( self == mtc ) {
        if ( self == mtc ) {
@@ -424,6 +413,46 @@ module LibCommon_Sync {
        }
        }
      }
      }
      
      
      /**
       * @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_clientSyncAndVerdictTestBody
       *         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_selfOrClientSyncAndVerdictTestBody( in charstring p_syncPoint,
                             in FncRetCode p_ret)
      runs on SelfSyncComp {
        if ( self == mtc ) {
          // then assume we are running non-conurrent test case
          f_selfSyncAndVerdictTestBody(p_syncPoint, p_ret);
        } else {
          f_clientSyncAndVerdictTestBody(p_syncPoint, p_ret);
        }
      }
      
      /**
       * @desc   Function kept for backward compatibility
       * @see    f_selfOrClientSyncAndVerdictPreamble
       *      
       */
      function f_selfOrClientSyncAndVerdictPR( in charstring p_syncPoint,
                             in FncRetCode p_ret)
      runs on SelfSyncComp {
          f_selfOrClientSyncAndVerdictPreamble(p_syncPoint, p_ret);
      }

    } // end group syncFunctions
    } // end group syncFunctions


    group syncCompStateHandling {
    group syncCompStateHandling {
@@ -526,7 +555,7 @@ module LibCommon_Sync {


    } // end group syncCompStateHandling
    } // end group syncCompStateHandling


    group exampleShutDownAltstep {
    group shutDownAltsteps {


      /**
      /**
       * @desc   This is an example of a shutdown altstep which can be
       * @desc   This is an example of a shutdown altstep which can be
@@ -581,7 +610,20 @@ module LibCommon_Sync {
          }
          }
      } // end altstep a_dummyShutDown
      } // end altstep a_dummyShutDown
      
      
    } // end group exampleShutDownAltstep
      /**
       * @desc Shutdown alstep in case the sync server is requesting shutdown. 
       * 
       * @remark User shall stop the component 
       */
      altstep a_shutdown() 
      runs on ClientSyncComp {
        []  syncPort.receive(m_syncServerStop){
            tc_sync.stop ;
            log("**** a_shutdown: Test component received STOP signal from MTC **** ");
          }              
      }

    } // end group shutDownAltsteps


  } // end group basicUserRelevantDefinitions
  } // end group basicUserRelevantDefinitions


@@ -610,6 +652,28 @@ module LibCommon_Sync {
        f_serverSyncClientsTimed(p_noOfClients,p_syncId, PX_TSYNC_TIME_LIMIT);
        f_serverSyncClientsTimed(p_noOfClients,p_syncId, PX_TSYNC_TIME_LIMIT);
      }
      }


      /**
       * @desc   Implements synchronization of "n" clients from server
       *         side including intermediate synchronization. 
       *         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_serverSyncClientsIntermediateSync( in UInt p_noOfClients, in charstring p_syncId, in UInt p_NoOfClientIntermediate, in template (present) charstring p_syncIdIntermediate )
      runs on ServerSyncComp {
          f_serverSyncClientsTimedIntermediateSync(p_noOfClients,p_syncId, p_NoOfClientIntermediate, p_syncIdIntermediate, PX_TSYNC_TIME_LIMIT);
      }
  
      /**
      /**
       * @desc   Handles synchronization of clients from server side.
       * @desc   Handles synchronization of clients from server side.
       *         If problem occurs, then server sends STOP to all clients.
       *         If problem occurs, then server sends STOP to all clients.
@@ -626,10 +690,30 @@ module LibCommon_Sync {
                        in charstring   p_syncId,
                        in charstring   p_syncId,
                        float       p_execTimeLimit )
                        float       p_execTimeLimit )
      runs on ServerSyncComp {
      runs on ServerSyncComp {
          f_serverSyncClientsTimedIntermediateSync(p_NoOfClients, p_syncId, 0, ?, p_execTimeLimit )
      } // end function f_serverSyncClientsTimed


        var integer v_noOfRecvdSyncMsgs := 0;
      /** @desc Handles synchronization of clients from server side including
       *      intermediate synchronization.
       *      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
       * @return  execution status
       */
      function f_serverSyncClientsTimedIntermediateSync(  in UInt     p_NoOfClients,
                        in charstring   p_syncId, in UInt p_NoOfClientIntermediate, in template (present) charstring p_syncIdIntermediate,
                        float       p_execTimeLimit )
      runs on ServerSyncComp {

        var integer v_noOfRecvdSyncMsgs := 0, v_noOfRecvdSyncMsgsIntermediate := 0;
        var boolean v_stopClients := false;
        var boolean v_stopClients := false;
        var ClientSyncCompList v_clientRefs := {};
        var ClientSyncCompList v_clientRefs := {}, v_clientRefsIntermediate := {};
        var ClientSyncComp v_clientRef;
        var ClientSyncComp v_clientRef;


        if ( p_syncId == c_prDone ) {
        if ( p_syncId == c_prDone ) {
@@ -643,22 +727,40 @@ module LibCommon_Sync {
        }
        }
        tc_sync.start(p_execTimeLimit) ;
        tc_sync.start(p_execTimeLimit) ;
        alt{
        alt{
          [v_noOfRecvdSyncMsgsIntermediate != p_NoOfClientIntermediate]  syncPort.receive(m_syncClientReady(p_syncIdIntermediate)) -> sender v_clientRef {
              if(not f_isPresentInArray(v_clientRef, v_clientRefsIntermediate)) {
                  v_clientRefsIntermediate[v_noOfRecvdSyncMsgsIntermediate] := v_clientRef;
                  v_noOfRecvdSyncMsgsIntermediate := v_noOfRecvdSyncMsgsIntermediate + 1;
                  if (v_noOfRecvdSyncMsgsIntermediate == p_NoOfClientIntermediate) {
                      f_serverSendToAllClients(v_clientRefsIntermediate, m_syncServerReady(p_syncIdIntermediate));
                  }
              }
              repeat;
            }
          []  syncPort.receive(m_syncClientReady(p_syncId)) -> sender v_clientRef {
          []  syncPort.receive(m_syncClientReady(p_syncId)) -> sender v_clientRef {
              if(not f_isPresentInArray(v_clientRef, v_clientRefs)) {
                  v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef;
                  v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef;
                  v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1;
                  v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1;
              }
              if ( v_noOfRecvdSyncMsgs != p_NoOfClients ) { repeat; }
              if ( v_noOfRecvdSyncMsgs != p_NoOfClients ) { repeat; }
            }
            }
          []  syncPort.receive(m_syncClientStop) -> sender v_clientRef {
          []  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! ****") ;
              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_stopClients := true;
              if(not f_isPresentInArray(v_clientRef, v_clientRefs)) {
                  v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef;
                  v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef;
                  v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1;
                  v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1;
              }
              if ( v_noOfRecvdSyncMsgs != p_NoOfClients ) { repeat; }
              if ( v_noOfRecvdSyncMsgs != p_NoOfClients ) { repeat; }

            }
            }
          []  syncPort.receive(m_syncClientReady(?)) -> sender v_clientRef {
          []  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! ****") ;
              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_stopClients := true;
                v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; }
              if(not f_isPresentInArray(v_clientRef, v_clientRefs)) {
                  v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; 
              }
          }
          []  syncPort.receive(SyncCmd :? ) {
          []  syncPort.receive(SyncCmd :? ) {
              log("**** f_serverSyncClientsTimed: Sync server received (invalid) sync message from other sync server - server will stop all clients! ****") ;
              log("**** f_serverSyncClientsTimed: Sync server received (invalid) sync message from other sync server - server will stop all clients! ****") ;
              v_stopClients := true; }
              v_stopClients := true; }
@@ -671,6 +773,9 @@ module LibCommon_Sync {
              log("**** f_serverSyncClientsTimed: A client is not responding within specified time limit - sync server is sending stop to all clients! ****");
              log("**** f_serverSyncClientsTimed: A client is not responding within specified time limit - sync server is sending stop to all clients! ****");
              v_stopClients := true; }
              v_stopClients := true; }
        } //end alt
        } //end alt
        if (v_noOfRecvdSyncMsgsIntermediate != p_NoOfClientIntermediate) {
            v_stopClients := true;
        }
        tc_sync.stop ;
        tc_sync.stop ;
        if ( v_stopClients ) {
        if ( v_stopClients ) {
          setverdict(inconc);
          setverdict(inconc);
@@ -689,7 +794,7 @@ module LibCommon_Sync {
            log("**** f_serverSyncClientsTimed: Sync server successfully passed synchronization point. ****") ;
            log("**** f_serverSyncClientsTimed: Sync server successfully passed synchronization point. ****") ;
          }
          }
        }
        }
      } // end function f_serverSyncClientsTimed
      } // end function f_serverSyncClientsTimedIntermediateSync


      /**
      /**
       * @desc  This function is intended only for use on the sync
       * @desc  This function is intended only for use on the sync
@@ -709,10 +814,10 @@ module LibCommon_Sync {
            }
            }
          [] tc_sync.timeout {
          [] tc_sync.timeout {
              log("**** f_serverWaitForAllClientsToStop: Not all sync clients have finshed execution within the sync time limit. Sync server will stop test case! ****") ;
              log("**** f_serverWaitForAllClientsToStop: Not all sync clients have finshed execution within the sync time limit. Sync server will stop test case! ****") ;
              stop;
            }
            }
        } // end alt
        } // end alt
        setverdict(pass);
        setverdict(pass);
          stop;
      } // end function f_serverWaitForAllClientsToStop
      } // end function f_serverWaitForAllClientsToStop


    } // end group serverRelated
    } // end group serverRelated
@@ -741,6 +846,36 @@ module LibCommon_Sync {
        disconnect(self:syncPort, mtc:syncPort);
        disconnect(self:syncPort, mtc:syncPort);
      }// end function f_disconnect4ClientSync
      }// end function f_disconnect4ClientSync


      /**
       * @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 {
        if(vc_testcaseStep == e_preamble) {
            f_clientSyncAndVerdictPreamble(p_syncId, p_ret);
        } else if(vc_testcaseStep == e_testBody) {
            f_clientSyncAndVerdictTestBody(p_syncId, p_ret);
        }
        else {
            f_clientSyncAndVerdictPostamble(p_syncId, p_ret);
        }
      }

      /**
      /**
       * @desc   This function combines client verdict setting with its
       * @desc   This function combines client verdict setting with its
       *         synchronization for use after or within a preamble
       *         synchronization for use after or within a preamble
@@ -761,6 +896,7 @@ module LibCommon_Sync {
      runs on ClientSyncComp {
      runs on ClientSyncComp {
        f_setVerdictPreamble(p_ret);
        f_setVerdictPreamble(p_ret);
        f_clientSync(p_syncId,p_ret);
        f_clientSync(p_syncId,p_ret);
        vc_testcaseStep := e_testBody;
      }
      }


      /**
      /**
@@ -780,11 +916,12 @@ module LibCommon_Sync {
       * @see    LibCommon_VerdictControl.f_setVerdict
       * @see    LibCommon_VerdictControl.f_setVerdict
       * @see    LibCommon_Sync.f_selfOrClientSyncAndVerdict
       * @see    LibCommon_Sync.f_selfOrClientSyncAndVerdict
       */
       */
      function f_clientSyncAndVerdict(in charstring p_syncId,
      function f_clientSyncAndVerdictTestBody(in charstring p_syncId,
                      in FncRetCode p_ret)
                      in FncRetCode p_ret)
      runs on ClientSyncComp {
      runs on ClientSyncComp {
        f_setVerdict(p_ret);
        f_setVerdict(p_ret);
        f_clientSync(p_syncId,p_ret);
        f_clientSync(p_syncId,p_ret);
        vc_testcaseStep := e_postamble;
      }
      }


      /**
      /**
@@ -914,13 +1051,13 @@ module LibCommon_Sync {
       * @desc  Default time limit for a sync client to reach a
       * @desc  Default time limit for a sync client to reach a
       *        synchronization point
       *        synchronization point
       */
       */
      modulepar {float PX_TSYNC_TIME_LIMIT := 120.0}
      modulepar float PX_TSYNC_TIME_LIMIT := 120.0;


      /*
      /*
       * @desc  Default time limit for a sync client to finish
       * @desc  Default time limit for a sync client to finish
       *        its execution of the shutdown default
       *        its execution of the shutdown default
       */
       */
      modulepar {float PX_TSHUT_DOWN_TIME_LIMIT := 120.0}
      modulepar float PX_TSHUT_DOWN_TIME_LIMIT := 120.0;
    }
    }


    group otherSyncTypes {
    group otherSyncTypes {
@@ -957,7 +1094,7 @@ module LibCommon_Sync {


      /**
      /**
       * @desc  This function combines MTC verdict setting with self
       * @desc  This function combines MTC verdict setting with self
       *        synchronization for use after and possibly in the test body
       *        synchronization for use in the preamble / test body / postamble
       * @param p_syncId Synchronization point name/id
       * @param p_syncId Synchronization point name/id
       * @param p_ret Current behavior execution status
       * @param p_ret Current behavior execution status
       * @see   LibCommon_VerdictControl.f_setVerdict
       * @see   LibCommon_VerdictControl.f_setVerdict
@@ -967,8 +1104,14 @@ module LibCommon_Sync {
      function f_selfSyncAndVerdict(  in charstring p_syncId,
      function f_selfSyncAndVerdict(  in charstring p_syncId,
                      in FncRetCode p_ret )
                      in FncRetCode p_ret )
      runs on SelfSyncComp {
      runs on SelfSyncComp {
        f_setVerdict(p_ret);
        if(vc_testcaseStep == e_preamble) {
        f_selfSync(p_syncId,p_ret);
            f_selfSyncAndVerdictPreamble(p_syncId, p_ret);
        } else if(vc_testcaseStep == e_testBody) {
            f_selfSyncAndVerdictTestBody(p_syncId, p_ret);
        }
        else {
            f_selfSyncAndVerdictPostamble(p_syncId, p_ret);
        }
      }
      }


      /**
      /**
@@ -982,8 +1125,25 @@ module LibCommon_Sync {
      function f_selfSyncAndVerdictPreamble(  in charstring p_syncId,
      function f_selfSyncAndVerdictPreamble(  in charstring p_syncId,
                          in FncRetCode p_ret )
                          in FncRetCode p_ret )
      runs on SelfSyncComp {
      runs on SelfSyncComp {
        f_setVerdictPreamble(p_ret);
        f_setVerdictPreOrPostamble(p_ret);
        f_selfSync(p_syncId,p_ret);
        f_selfSync(p_syncId,p_ret);
        vc_testcaseStep := e_testBody;
      }
      
      /**
       * @desc  This function combines MTC verdict setting with self
       *        synchronization for use after 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
       */
      function f_selfSyncAndVerdictTestBody(  in charstring p_syncId,
                          in FncRetCode p_ret )
      runs on SelfSyncComp {
        f_setVerdict(p_ret);
        f_selfSync(p_syncId,p_ret);
        vc_testcaseStep := e_postamble;
      }
      }


      /**
      /**
@@ -997,7 +1157,7 @@ module LibCommon_Sync {
      function f_selfSyncAndVerdictPostamble( in charstring p_syncId ,
      function f_selfSyncAndVerdictPostamble( in charstring p_syncId ,
                          in FncRetCode p_ret )
                          in FncRetCode p_ret )
      runs on SelfSyncComp {
      runs on SelfSyncComp {
        f_setVerdictPostamble(p_ret);
        f_setVerdictPreOrPostamble(p_ret);
        f_selfSync(p_syncId,p_ret);
        f_selfSync(p_syncId,p_ret);
      }
      }


@@ -1098,11 +1258,11 @@ module LibCommon_Sync {
    } // end group syncProtocolDefinition
    } // end group syncProtocolDefinition


    group syncMessages {
    group syncMessages {
      template SyncCmd m_syncClientReady( template charstring p_syncId ) := {
      template SyncCmd m_syncClientReady( template (present) charstring p_syncId ) := {
        clientReady := { p_syncId }
        clientReady := { p_syncId }
      }
      }


      template SyncCmd m_syncServerReady( template charstring p_syncId ) := {
      template SyncCmd m_syncServerReady( template (present) charstring p_syncId ) := {
        serverReady := { p_syncId }
        serverReady := { p_syncId }
      }
      }


@@ -1124,11 +1284,11 @@ module LibCommon_Sync {
       * @param p_syncCmd The actual synchronization message to be sent out
       * @param p_syncCmd The actual synchronization message to be sent out
       */
       */
      function f_serverSendToAllClients(  in ClientSyncCompList p_clientRefs,
      function f_serverSendToAllClients(  in ClientSyncCompList p_clientRefs,
                        in template SyncCmd p_syncCmd)
                        in template (value) SyncCmd p_syncCmd)
      runs on ServerSyncComp {
      runs on ServerSyncComp {
        var integer i:=0;
        var integer i:=0;
        for (i:=0; i< sizeof(p_clientRefs); i:=i+1 ){
        for (i:=0; i< sizeof(p_clientRefs); i:=i+1 ){
          syncPort.send(p_syncCmd) to p_clientRefs[i];
          syncPort.send(p_syncCmd) to valueof(p_clientRefs[i]);
        }
        }
      } // end function f_serverSendToAllClients
      } // end function f_serverSendToAllClients


@@ -1145,6 +1305,9 @@ module LibCommon_Sync {


        tc_shutDown.start(PX_TSHUT_DOWN_TIME_LIMIT);
        tc_shutDown.start(PX_TSHUT_DOWN_TIME_LIMIT);
        alt {
        alt {
          [] syncPort.receive {
          	// clients may still try to send some sync message
          }        	
          [] all component.done {
          [] all component.done {
            tc_shutDown.stop;
            tc_shutDown.stop;
            log("**** f_serverWaitForAllClientsToShutDown: All components have properly shut down. Sync server will now terminate the test case. ****") ;
            log("**** f_serverWaitForAllClientsToShutDown: All components have properly shut down. Sync server will now terminate the test case. ****") ;
@@ -1155,9 +1318,30 @@ module LibCommon_Sync {
        } // end alt
        } // end alt
        // cover case that shut down default is NOT activated
        // cover case that shut down default is NOT activated
        setverdict(inconc);
        setverdict(inconc);
          mtc.stop;
          //mtc.stop;
		syncPort.send(m_syncServerStop) to self; // 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_serverWaitForAllClientsToShutDown
      } // end function f_serverWaitForAllClientsToShutDown


		function f_isPresentInArray(in ClientSyncComp p_clientRef, in ClientSyncCompList p_clientRefs)
		return boolean {
			var integer i;
			for(i:=0; i < sizeof(p_clientRefs); i:=i+1) {
				if(p_clientRefs[i] == p_clientRef) {
					return true;
				}
			}
			return false;
		}
    } // end group otherSyncFunctions
    } // end group otherSyncFunctions


  } // end group otherSyncDefinitions
  } // end group otherSyncDefinitions
+5 −5
Original line number Original line Diff line number Diff line
@@ -18,31 +18,31 @@ module LibCommon_Time {
     * @desc    Time to control PTC.stop
     * @desc    Time to control PTC.stop
     * @remark  PICS/PIXIT Reference: XXX
     * @remark  PICS/PIXIT Reference: XXX
    */
    */
    modulepar {float PX_TDONE := 120.0}
    modulepar float PX_TDONE := 120.0;


    /**
    /**
     * @desc    Time to control the reception of a message
     * @desc    Time to control the reception of a message
     * @remark  PICS/PIXIT Reference: XXX
     * @remark  PICS/PIXIT Reference: XXX
    */
    */
    modulepar {float PX_TAC := 30.0}
    modulepar float PX_TAC := 30.0;


    /**
    /**
     * @desc    Time to control that IUT sends nothing
     * @desc    Time to control that IUT sends nothing
     * @remark  PICS/PIXIT Reference: XXX
     * @remark  PICS/PIXIT Reference: XXX
    */
    */
    modulepar {float PX_TNOAC := 10.0}
    modulepar float PX_TNOAC := 10.0;


    /**
    /**
     * @desc    Time to control that IUT reacts prior to Upper Tester action
     * @desc    Time to control that IUT reacts prior to Upper Tester action
     * @remark  PICS/PIXIT Reference: XXX
     * @remark  PICS/PIXIT Reference: XXX
    */
    */
    modulepar {float PX_TWAIT := 120.0}
    modulepar float PX_TWAIT := 120.0;


    /**
    /**
     * @desc    Time to control sending in loops
     * @desc    Time to control sending in loops
     * @remark  PICS/PIXIT Reference: XXX
     * @remark  PICS/PIXIT Reference: XXX
    */
    */
    modulepar {float PX_LOOP := 1.0}
    modulepar float PX_LOOP := 1.0;


  } // end group timeLibModuleParameters
  } // end group timeLibModuleParameters


+2 −4
Original line number Original line Diff line number Diff line
@@ -81,14 +81,12 @@
   * @desc 	This function should be used for verdict
   * @desc 	This function should be used for verdict
	 *			  setting outside the test body.
	 *			  setting outside the test body.
	 *		    Sets verdicts are INCONC in case of a timeout or
	 *		    Sets verdicts are INCONC in case of a timeout or
	 *        an error, and PASS otherwise.
	 *        an error
	 * @param p_ret Postamble execution status
	 * @param p_ret Postamble execution status
	 */
	 */
	function f_setVerdictPreOrPostamble ( FncRetCode p_ret ) {
	function f_setVerdictPreOrPostamble ( FncRetCode p_ret ) {
		if ( p_ret != e_success ) {
		if ( p_ret != e_success ) {
			setverdict(inconc);
			setverdict(inconc);
		} else {
			setverdict(pass);
		} 
		} 
	} // end function f_setVerdictPreOrPostamble
	} // end function f_setVerdictPreOrPostamble