|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Defines debug assert macroes for Connection Multiplexer |
|
15 * module |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef NCMCONNECTIONMULTIPLEXERASSERT_H |
|
23 #define NCMCONNECTIONMULTIPLEXERASSERT_H |
|
24 |
|
25 #include <e32std.h> |
|
26 |
|
27 #if defined( _DEBUG ) && !defined( TEST_EUNIT ) |
|
28 |
|
29 //Panic is used in debug builds, so the exact location where the assertion |
|
30 //failed is caught early in testing. |
|
31 #define __CONNECTIONMULTIPLEXER_PANIC( i ) \ |
|
32 User::Panic( KNullDesC, ( i ) ) |
|
33 |
|
34 #define __CONNECTIONMULTIPLEXER_ASSERT_L( c, i ) \ |
|
35 __ASSERT_ALWAYS( c, __CONNECTIONMULTIPLEXER_PANIC( i ) ) |
|
36 |
|
37 #define __CONNECTIONMULTIPLEXER_ASSERT_RETURN( c, i ) \ |
|
38 __ASSERT_ALWAYS( c, __CONNECTIONMULTIPLEXER_PANIC( i ) ) |
|
39 |
|
40 #define __CONNECTIONMULTIPLEXER_ASSERT_RETURN_VALUE( c, i ) \ |
|
41 __ASSERT_ALWAYS( c, __CONNECTIONMULTIPLEXER_PANIC( i ) ) |
|
42 |
|
43 #define __CONNECTIONMULTIPLEXER_FAILURE_L( i ) \ |
|
44 __CONNECTIONMULTIPLEXER_PANIC( i ) |
|
45 #define __CONNECTIONMULTIPLEXER_FAILURE_RETURN( i ) \ |
|
46 __CONNECTIONMULTIPLEXER_PANIC( i ) |
|
47 |
|
48 #else |
|
49 |
|
50 //For release builds, leave is used instead of panic. |
|
51 #define __CONNECTIONMULTIPLEXER_ASSERT_L( c, i ) \ |
|
52 __ASSERT_ALWAYS( c, User::Leave( i ) ) |
|
53 #define __CONNECTIONMULTIPLEXER_ASSERT_RETURN( c, i ) \ |
|
54 if ( !( c ) ) return |
|
55 #define __CONNECTIONMULTIPLEXER_ASSERT_RETURN_VALUE( c, i ) \ |
|
56 if ( !( c ) ) return ( i ) |
|
57 |
|
58 #define __CONNECTIONMULTIPLEXER_FAILURE_L( i ) \ |
|
59 User::Leave( i ) |
|
60 #define __CONNECTIONMULTIPLEXER_FAILURE_RETURN( i ) return |
|
61 |
|
62 #endif |
|
63 |
|
64 |
|
65 #endif // NCMCONNECTIONMULTIPLEXERASSERT_H |