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> |
|
27 // Next row is to disable warning emerging from EUnit code. |
26 // Next row is to disable warning emerging from EUnit code. |
28 // Placement is due to a fact that most test case files |
27 // Placement is due to a fact that most test case files |
29 // include this file. Directive can be removed when |
28 // include this file. Directive can be removed when |
30 // EUnit is fixed. |
29 // EUnit is fixed. |
31 #pragma warn_illtokenpasting off |
30 #pragma warn_illtokenpasting off |
32 |
31 |
33 // Test values |
32 // Test values |
34 |
33 |
35 _LIT( KTestRecipientSipUri, "sip:TestRecipient@host.domain" ); |
34 _LIT( KTestRecipientSipUri, "sip:TestRecipient@host.domain" ); |
36 _LIT( KTestRecipient2SipUri, "sip:TestRecipient2@host.domain" ); |
|
37 _LIT( KTestRecipientSipUriPrefixUpperCase, "SIP:TestRecipient@host.domain" ); |
35 _LIT( KTestRecipientSipUriPrefixUpperCase, "SIP:TestRecipient@host.domain" ); |
38 _LIT( KTestRecipientSipUriNoSipPrefix, "TestRecipient@host.domain" ); |
36 _LIT( KTestRecipientSipUriNoSipPrefix, "TestRecipient@host.domain" ); |
39 _LIT( KTestRecipientTelUri, "tel:+3581111111"); |
37 _LIT( KTestRecipientTelUri, "tel:+3581111111"); |
40 _LIT( KTestRecipientTelUriNoTelPrefix, "+3581111111" ); |
38 _LIT( KTestRecipientTelUriNoTelPrefix, "+3581111111" ); |
41 |
39 |
42 _LIT8( KTestRecipientSipUri8, "sip:TestRecipient@host.domain" ); |
40 _LIT8( KTestRecipientSipUri8, "sip:TestRecipient@host.domain" ); |
43 _LIT8( KTestRecipient2SipUri8, "sip:TestRecipient2@host.domain" ); |
|
44 _LIT8( KTestRecipientSipUriPrefixUpperCase8, "SIP:TestRecipient@host.domain" ); |
41 _LIT8( KTestRecipientSipUriPrefixUpperCase8, "SIP:TestRecipient@host.domain" ); |
45 _LIT8( KTestRecipientSipUriNoSipPrefix8, "TestRecipient@host.domain" ); |
42 _LIT8( KTestRecipientSipUriNoSipPrefix8, "TestRecipient@host.domain" ); |
46 _LIT8( KTestRecipientTelUri8, "tel:+3581111111"); |
43 _LIT8( KTestRecipientTelUri8, "tel:+3581111111"); |
47 _LIT8( KTestRecipientTelUriNoTelPrefix8, "+3581111111" ); |
44 _LIT8( KTestRecipientTelUriNoTelPrefix8, "+3581111111" ); |
48 |
45 |
118 if ( error == KErrNoMemory )\ |
115 if ( error == KErrNoMemory )\ |
119 {\ |
116 {\ |
120 User::Leave( error );\ |
117 User::Leave( error );\ |
121 } |
118 } |
122 |
119 |
123 // NOTE! NMusSessionApi::KCategoryUid, NMusSessionApi::KRemoteSipAddress p&s property |
|
124 // should contain recipient address to be used for invitation. |
|
125 // |
|
126 #define ESTABLISH_OUT_SESSION( outSession )\ |
120 #define ESTABLISH_OUT_SESSION( outSession )\ |
127 outSession->EstablishLcSessionL();\ |
121 outSession->InviteL( KTestRecipientSipUri );\ |
128 outSession->iSession->iState = CMceSession::EEstablished;\ |
122 outSession->iSession->iState = CMceSession::EEstablished;\ |
129 for ( TInt i = 0; i < outSession->iSession->Streams().Count(); ++i )\ |
123 for ( TInt i = 0; i < outSession->iSession->Streams().Count(); ++i )\ |
130 {\ |
124 {\ |
131 outSession->iSession->Streams()[i]->iState =\ |
125 outSession->iSession->Streams()[i]->iState =\ |
132 CMceMediaStream::EStreaming;\ |
126 CMceMediaStream::EStreaming;\ |
140 } |
134 } |
141 |
135 |
142 #define ESTABLISH_OUT_SESSION_AND_START_STREAMING( outSession )\ |
136 #define ESTABLISH_OUT_SESSION_AND_START_STREAMING( outSession )\ |
143 ESTABLISH_OUT_SESSION( outSession );\ |
137 ESTABLISH_OUT_SESSION( outSession );\ |
144 outSession->EnableDisplayL( ETrue );\ |
138 outSession->EnableDisplayL( ETrue );\ |
145 outSession->LocalVideoPlayer()->LcPlayL(); |
139 outSession->PlayL(); |
146 |
140 |
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 } |
|
169 |
141 |
170 #endif // MUSENGTESTDEFS_H |
142 #endif // MUSENGTESTDEFS_H |
171 |
143 |
172 |
144 |