mmsharing/mmshengine/tsrc/ut_engine/inc/musengtestdefs.h
branchRCL_3
changeset 22 73a1feb507fb
parent 0 f0cf47e981f9
child 23 bc78a40cd63c
equal deleted inserted replaced
21:33a5d2bbf6fc 22:73a1feb507fb
    21 #define MUSENGTESTDEFS_H
    21 #define MUSENGTESTDEFS_H
    22 
    22 
    23 #include <mcesession.h>
    23 #include <mcesession.h>
    24 #include <mcemanager.h>
    24 #include <mcemanager.h>
    25 
    25 
       
    26 #include <digia/eunit/eunitmacros.h>
    26 // Next row is to disable warning emerging from EUnit code.
    27 // Next row is to disable warning emerging from EUnit code.
    27 // Placement is due to a fact that most test case files
    28 // Placement is due to a fact that most test case files
    28 // include this file. Directive can be removed when 
    29 // include this file. Directive can be removed when 
    29 // EUnit is fixed.  
    30 // EUnit is fixed.  
    30 #pragma warn_illtokenpasting off
    31 #pragma warn_illtokenpasting off
    31 
    32 
    32 // Test values
    33 // Test values
    33 
    34 
    34 _LIT( KTestRecipientSipUri, "sip:TestRecipient@host.domain" );
    35 _LIT( KTestRecipientSipUri, "sip:TestRecipient@host.domain" );
       
    36 _LIT( KTestRecipient2SipUri, "sip:TestRecipient2@host.domain" );
    35 _LIT( KTestRecipientSipUriPrefixUpperCase, "SIP:TestRecipient@host.domain" );
    37 _LIT( KTestRecipientSipUriPrefixUpperCase, "SIP:TestRecipient@host.domain" );
    36 _LIT( KTestRecipientSipUriNoSipPrefix, "TestRecipient@host.domain" );
    38 _LIT( KTestRecipientSipUriNoSipPrefix, "TestRecipient@host.domain" );
    37 _LIT( KTestRecipientTelUri, "tel:+3581111111");
    39 _LIT( KTestRecipientTelUri, "tel:+3581111111");
    38 _LIT( KTestRecipientTelUriNoTelPrefix, "+3581111111" );
    40 _LIT( KTestRecipientTelUriNoTelPrefix, "+3581111111" );
    39 
    41 
    40 _LIT8( KTestRecipientSipUri8, "sip:TestRecipient@host.domain" );
    42 _LIT8( KTestRecipientSipUri8, "sip:TestRecipient@host.domain" );
       
    43 _LIT8( KTestRecipient2SipUri8, "sip:TestRecipient2@host.domain" );
    41 _LIT8( KTestRecipientSipUriPrefixUpperCase8, "SIP:TestRecipient@host.domain" );
    44 _LIT8( KTestRecipientSipUriPrefixUpperCase8, "SIP:TestRecipient@host.domain" );
    42 _LIT8( KTestRecipientSipUriNoSipPrefix8, "TestRecipient@host.domain" );
    45 _LIT8( KTestRecipientSipUriNoSipPrefix8, "TestRecipient@host.domain" );
    43 _LIT8( KTestRecipientTelUri8, "tel:+3581111111");
    46 _LIT8( KTestRecipientTelUri8, "tel:+3581111111");
    44 _LIT8( KTestRecipientTelUriNoTelPrefix8, "+3581111111" );
    47 _LIT8( KTestRecipientTelUriNoTelPrefix8, "+3581111111" );
    45 
    48 
   115     if ( error == KErrNoMemory )\
   118     if ( error == KErrNoMemory )\
   116         {\
   119         {\
   117         User::Leave( error );\
   120         User::Leave( error );\
   118         }
   121         }
   119 
   122 
       
   123 // NOTE! NMusSessionApi::KCategoryUid, NMusSessionApi::KRemoteSipAddress p&s property
       
   124 // should contain recipient address to be used for invitation.
       
   125 //
   120 #define ESTABLISH_OUT_SESSION( outSession )\
   126 #define ESTABLISH_OUT_SESSION( outSession )\
   121     outSession->InviteL( KTestRecipientSipUri );\
   127     outSession->EstablishLcSessionL();\
   122     outSession->iSession->iState = CMceSession::EEstablished;\
   128     outSession->iSession->iState = CMceSession::EEstablished;\
   123     for ( TInt i = 0; i < outSession->iSession->Streams().Count(); ++i )\
   129     for ( TInt i = 0; i < outSession->iSession->Streams().Count(); ++i )\
   124             {\
   130             {\
   125             outSession->iSession->Streams()[i]->iState =\
   131             outSession->iSession->Streams()[i]->iState =\
   126                                                 CMceMediaStream::EStreaming;\
   132                                                 CMceMediaStream::EStreaming;\
   134         }
   140         }
   135 
   141 
   136 #define ESTABLISH_OUT_SESSION_AND_START_STREAMING( outSession )\
   142 #define ESTABLISH_OUT_SESSION_AND_START_STREAMING( outSession )\
   137     ESTABLISH_OUT_SESSION( outSession );\
   143     ESTABLISH_OUT_SESSION( outSession );\
   138     outSession->EnableDisplayL( ETrue );\
   144     outSession->EnableDisplayL( ETrue );\
   139     outSession->PlayL();
   145     outSession->LocalVideoPlayer()->LcPlayL();
   140     
   146 
       
   147 
       
   148 #define MUSENG_EUNIT_ASSERT_EQUALS( func, val ) \
       
   149 {\
       
   150 TInt musUnitTestRetVal = func;\
       
   151 if ( musUnitTestRetVal != KErrNoMemory ){\
       
   152     EUNIT_ASSERT_EQUALS( musUnitTestRetVal, val );\
       
   153     }\
       
   154 else{\
       
   155     User::Leave( KErrNoMemory );\
       
   156     }\
       
   157 }
       
   158 
       
   159 #define MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( func, val ) \
       
   160 {\
       
   161 TRAPD( musUnitTestRetVal, func );\
       
   162 if ( val != KErrNoMemory && musUnitTestRetVal == KErrNoMemory ){\
       
   163     User::Leave( KErrNoMemory );\
       
   164     }\
       
   165 else{\
       
   166     EUNIT_ASSERT_EQUALS( musUnitTestRetVal, val );\
       
   167     }\
       
   168 }
   141     
   169     
   142 #endif // MUSENGTESTDEFS_H
   170 #endif // MUSENGTESTDEFS_H
   143 
   171 
   144  
   172