rtp/rtpstack/tsrc/ut_rtpstack/inc/UT_CRtpComm.h
changeset 0 307788aac0a8
child 19 b5e99d8877c7
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __UT_CRTPCOMM_H__
       
    22 #define __UT_CRTPCOMM_H__
       
    23 
       
    24 //  EXTERNAL INCLUDES
       
    25 #include <digia/eunit/ceunittestsuiteclass.h>
       
    26 #include "rtpsession.h"
       
    27 
       
    28 #include <commdbconnpref.h>
       
    29 #include <es_sock.h>
       
    30 
       
    31 // include the class to be tested
       
    32 #include "rtpcomm.h"
       
    33 
       
    34 //  INTERNAL INCLUDES
       
    35 
       
    36 
       
    37 //  FORWARD DECLARATIONS
       
    38 class CRtpComm;
       
    39 
       
    40 #include <e32def.h>
       
    41 #ifndef NONSHARABLE_CLASS
       
    42     #define NONSHARABLE_CLASS(x) class x
       
    43 #endif
       
    44 
       
    45 //  CLASS DEFINITION
       
    46 /**
       
    47  *
       
    48  * EUnitWizard generated test class. 
       
    49  *
       
    50  */
       
    51 NONSHARABLE_CLASS( UT_CRtpComm )
       
    52      : public CEUnitTestSuiteClass,
       
    53       public MRtpErrNotify, 
       
    54       public MReceivedNotify
       
    55     {
       
    56     public:     // Constructors and destructors
       
    57 
       
    58         /**
       
    59          * Two phase construction
       
    60          */
       
    61         static UT_CRtpComm* NewL();
       
    62         static UT_CRtpComm* NewLC();
       
    63         /**
       
    64          * Destructor
       
    65          */
       
    66         ~UT_CRtpComm();
       
    67 
       
    68     private:    // Constructors and destructors
       
    69 
       
    70         UT_CRtpComm();
       
    71         void ConstructL();
       
    72 
       
    73     public:     // From observer interface
       
    74 
       
    75         void OnRtpReceivedL();
       
    76         void OnRtcpReceivedL();
       
    77         void OnReceptionError( TPortType aPort, TInt aError );
       
    78         void OnPacketRejected(TPortType aPort);  
       
    79         void ErrorNotify( TInt aErrCode ) ; 
       
    80 
       
    81     private:    // New methods
       
    82 
       
    83          void SetupL();
       
    84         
       
    85          void Teardown();
       
    86         
       
    87          void UT_CRtpComm_NewLL();
       
    88         
       
    89         
       
    90          void UT_CRtpComm_ConstructSenderLL();
       
    91         
       
    92         
       
    93          void UT_CRtpComm_ConstructReceiverLL();
       
    94         
       
    95         
       
    96          void UT_CRtpComm_SetToAddressL();
       
    97         
       
    98         
       
    99          void UT_CRtpComm_SetAcceptedFromAddressL();
       
   100         
       
   101         
       
   102          void UT_CRtpComm_SetRecvCallbackL();
       
   103         
       
   104         
       
   105          void UT_CRtpComm_SendL();
       
   106         
       
   107         
       
   108          void UT_CRtpComm_Send_1L();
       
   109         
       
   110         
       
   111          void UT_CRtpComm_CancelSendL();
       
   112         
       
   113         
       
   114          void UT_CRtpComm_ReceiveL();
       
   115         
       
   116         
       
   117          void UT_CRtpComm_RegisterReceivedNotifyL();
       
   118         
       
   119         
       
   120          void UT_CRtpComm_GetSocketL();
       
   121         
       
   122         
       
   123          void UT_CRtpComm_SetNonRtpObserverFlagL();
       
   124          
       
   125          void UT_CRtpComm_CommReceiveL(  );
       
   126          
       
   127          void UT_CRtpComm_MaxSocketSize();
       
   128          
       
   129     private:
       
   130     	static TInt StopScheduler( TAny* aThis );
       
   131 	
       
   132 		void DelayL();    
       
   133 
       
   134     private:    // Data
       
   135 
       
   136         EUNIT_DECLARE_TEST_TABLE; 
       
   137         CActiveSchedulerWait iWait;
       
   138 		TInt iEventCount;
       
   139 		TBool iCallBackCalled;
       
   140 		CPeriodic* iTimer;
       
   141 		RSocketServ iSocketServ;
       
   142     	RConnection iConnection;
       
   143         CRtpComm* iRtpComm;
       
   144         TUint iLocalPort;
       
   145     	TInt iErr;
       
   146 
       
   147     };
       
   148 
       
   149 #endif      //  __UT_CRTPCOMM_H__
       
   150 
       
   151 // End of file