0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// @internalComponent
|
|
15 |
// Collection of utility functions primarily assisting debuggers and maintainers.
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
#ifndef DEBUGMACROS_H
|
|
20 |
#define DEBUGMACROS_H
|
|
21 |
|
|
22 |
#include <e32debug.h> // RDebug class
|
|
23 |
#include "testengine.h"
|
|
24 |
|
|
25 |
/**
|
|
26 |
Debug macro for serial port logging of function names and signatures
|
|
27 |
e.g.
|
|
28 |
<Function> void CMyClass::MyFunction (TInt aParam)
|
|
29 |
*/
|
|
30 |
|
|
31 |
const TInt KErrAssertionInternal = 3;
|
|
32 |
|
|
33 |
#define TEST_ASSERTION(a,b) if (!(a)) {test.Printf(_L("ASSERTION FAILED!\n line %d file %S.\n"), \
|
|
34 |
__LINE__, __FILE__); test.Printf(b); \
|
|
35 |
__ASSERT_ALWAYS(a, User::Panic(_L("Test F/W Err"), KErrAssertionInternal));};
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
/**
|
|
40 |
Debug macro to output test in 'verbose' detail mode
|
|
41 |
*/
|
|
42 |
#define LOG_VERBOSE1(a) if (gVerboseOutput) test.Printf(a);
|
|
43 |
#define LOG_VERBOSE2(a,b) if (gVerboseOutput) test.Printf(a, b);
|
|
44 |
#define LOG_VERBOSE3(a,b,c) if (gVerboseOutput) test.Printf(a, b, c);
|
|
45 |
|
|
46 |
#define LOG_STEPNAME(a) PrintStepName(a);
|
|
47 |
|
|
48 |
/**
|
|
49 |
Panic the framework
|
|
50 |
*
|
|
51 |
#define PANIC_FRAMEWORK(a) RDebug::Printf("<Framework died '%s' %d %s",\
|
|
52 |
a, __LINE__, __FILE__); User::Panic(_LIT("Test F/W"), KErrUnknown);
|
|
53 |
*/
|
|
54 |
|
|
55 |
|
|
56 |
#endif // DEBUGMACROS_H
|
|
57 |
|