0
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2009 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 __ASSERT_H__
|
|
20 |
#define __ASSERT_H__
|
|
21 |
|
|
22 |
// asserte
|
|
23 |
// Extend assert to raise a panic that features the source file and
|
|
24 |
// line number that caused the assert.
|
|
25 |
#include <e32std.h>
|
|
26 |
extern void AssertE( TPtrC8 _file, TInt _line );
|
|
27 |
#define asserte(x) if(!(x)) { AssertE( (TPtrC8(reinterpret_cast<const TText8*>(__FILE__))), __LINE__); }
|
|
28 |
|
|
29 |
// assert
|
|
30 |
// Exit the program and show the message "Assert Failed".
|
|
31 |
#define assert(x) __ASSERT_ALWAYS((x),User::Panic(_L("Assert Failed"),0))
|
|
32 |
|
|
33 |
#endif //__ASSERT_H__
|
|
34 |
|