os/kernelhwsrv/kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 #define LOG_FUNC 	if (gVerboseOutput) RDebug::Printf("<Function> %s", __PRETTY_FUNCTION__);
    31 
    32 const TInt KErrAssertionInternal	= 3;
    33 
    34 #define TEST_ASSERTION(a,b) 	if (!(a)) {test.Printf(_L("ASSERTION FAILED!\n line %d file %S.\n"), \
    35 									__LINE__, __FILE__); test.Printf(b); \
    36 									__ASSERT_ALWAYS(a, User::Panic(_L("Test F/W Err"), KErrAssertionInternal));};
    37 
    38 
    39 #define LOG_FUNCERROR(a) RDebug::Printf("[WARNING %s failed %d]", __PRETTY_FUNCTION__, a);
    40 
    41 /**
    42 Debug macro to output test in 'verbose' detail mode
    43 */
    44 #define LOG_VERBOSE1(a) if (gVerboseOutput) test.Printf(a);
    45 #define LOG_VERBOSE2(a,b) if (gVerboseOutput) test.Printf(a, b);
    46 #define LOG_VERBOSE3(a,b,c) if (gVerboseOutput) test.Printf(a, b, c);
    47 
    48 #define LOG_STEPNAME(a) PrintStepName(a); 
    49 
    50 /**
    51  Panic the framework
    52 *
    53 #define PANIC_FRAMEWORK(a) RDebug::Printf("<Framework died '%s' %d %s",\
    54     a, __LINE__, __FILE__); User::Panic(_LIT("Test F/W"), KErrUnknown);
    55 */	
    56 
    57 
    58 #endif // DEBUGMACROS_H
    59