1 /* |
|
2 * Copyright (c) 2010 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 #ifndef STIFASSERT_MACRO_H |
|
20 #define STIFASSERT_MACRO_H |
|
21 |
|
22 #ifdef __STIF_ASSERT_SHARED |
|
23 #undef __STIF_ASSERT_SHARED |
|
24 /********************************************************************************* |
|
25 * Assert Macros |
|
26 *********************************************************************************/ |
|
27 #define __STIF_ASSERT_SHARED( aFunction, aMessage ) \ |
|
28 if(!aFunction) \ |
|
29 { \ |
|
30 iLog->Log( aMessage, __STIF_DBG_FILE__, __LINE__ );\ |
|
31 iResult.SetResult( KErrGeneral, _L("Testcase failed"));\ |
|
32 return;\ |
|
33 } |
|
34 #endif |
|
35 |
|
36 #ifdef __STIF_ASSERT_SHARED_DESC |
|
37 #undef __STIF_ASSERT_SHARED_DESC |
|
38 #define __STIF_ASSERT_SHARED_DESC( aFunction, aMessage, aDesc ) \ |
|
39 if(!aFunction) \ |
|
40 { \ |
|
41 iLog->Log( aMessage, __STIF_DBG_FILE__, __LINE__ );\ |
|
42 iResult.SetResult( KErrGeneral, aDesc );\ |
|
43 return;\ |
|
44 } \ |
|
45 else \ |
|
46 { \ |
|
47 iResult.SetResult( KErrNone, aDesc ); \ |
|
48 } |
|
49 #endif |
|
50 |
|
51 #ifdef STIF_ASSERT_PANIC_DESC |
|
52 #undef STIF_ASSERT_PANIC_DESC |
|
53 |
|
54 #define STIF_ASSERT_PANIC_DESC( aPanicCode, aStatement, aDescription ) \ |
|
55 { \ |
|
56 TestModuleIf().SetExitReason( CTestModuleIf::EPanic, aPanicCode ); \ |
|
57 iResult.SetResult(KErrNone, aDescription); \ |
|
58 aStatement; \ |
|
59 } |
|
60 #endif |
|
61 |
|
62 #endif |
|