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