os/kernelhwsrv/kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,59 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// @internalComponent
    1.18 +// Collection of utility functions primarily assisting debuggers and maintainers.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#ifndef DEBUGMACROS_H
    1.23 +#define DEBUGMACROS_H
    1.24 +
    1.25 +#include <e32debug.h> // RDebug class
    1.26 +#include "testengine.h"
    1.27 +
    1.28 +/**
    1.29 +Debug macro for serial port logging of function names and signatures
    1.30 + e.g. 
    1.31 +<Function> void CMyClass::MyFunction (TInt aParam)
    1.32 +*/
    1.33 +#define LOG_FUNC 	if (gVerboseOutput) RDebug::Printf("<Function> %s", __PRETTY_FUNCTION__);
    1.34 +
    1.35 +const TInt KErrAssertionInternal	= 3;
    1.36 +
    1.37 +#define TEST_ASSERTION(a,b) 	if (!(a)) {test.Printf(_L("ASSERTION FAILED!\n line %d file %S.\n"), \
    1.38 +									__LINE__, __FILE__); test.Printf(b); \
    1.39 +									__ASSERT_ALWAYS(a, User::Panic(_L("Test F/W Err"), KErrAssertionInternal));};
    1.40 +
    1.41 +
    1.42 +#define LOG_FUNCERROR(a) RDebug::Printf("[WARNING %s failed %d]", __PRETTY_FUNCTION__, a);
    1.43 +
    1.44 +/**
    1.45 +Debug macro to output test in 'verbose' detail mode
    1.46 +*/
    1.47 +#define LOG_VERBOSE1(a) if (gVerboseOutput) test.Printf(a);
    1.48 +#define LOG_VERBOSE2(a,b) if (gVerboseOutput) test.Printf(a, b);
    1.49 +#define LOG_VERBOSE3(a,b,c) if (gVerboseOutput) test.Printf(a, b, c);
    1.50 +
    1.51 +#define LOG_STEPNAME(a) PrintStepName(a); 
    1.52 +
    1.53 +/**
    1.54 + Panic the framework
    1.55 +*
    1.56 +#define PANIC_FRAMEWORK(a) RDebug::Printf("<Framework died '%s' %d %s",\
    1.57 +    a, __LINE__, __FILE__); User::Panic(_LIT("Test F/W"), KErrUnknown);
    1.58 +*/	
    1.59 +
    1.60 +
    1.61 +#endif // DEBUGMACROS_H
    1.62 +