kerneltest/e32test/usbho/t_otgdi/inc/debugmacros.h
author Slion
Tue, 08 Dec 2009 08:11:42 +0100
branchanywhere
changeset 19 f6d3d9676ee4
parent 0 a41df078684a
child 253 d37db4dcc88d
permissions -rw-r--r--
Trying to figure out how to implement my WINC like compatibility layer. Going the emulation way is probably not so smart. We should not use the kernel but rather hook native functions in the Exec calls.

// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// @internalComponent
// Collection of utility functions primarily assisting debuggers and maintainers.
// 
//

#ifndef DEBUGMACROS_H
#define DEBUGMACROS_H

#include <e32debug.h> // RDebug class
#include "testengine.h"

/**
Debug macro for serial port logging of function names and signatures
 e.g. 
<Function> void CMyClass::MyFunction (TInt aParam)
*/
#define LOG_FUNC 	if (gVerboseOutput) RDebug::Printf("<Function> %s", __PRETTY_FUNCTION__);

const TInt KErrAssertionInternal	= 3;

#define TEST_ASSERTION(a,b) 	if (!(a)) {test.Printf(_L("ASSERTION FAILED!\n line %d file %S.\n"), \
									__LINE__, __FILE__); test.Printf(b); \
									__ASSERT_ALWAYS(a, User::Panic(_L("Test F/W Err"), KErrAssertionInternal));};


#define LOG_FUNCERROR(a) RDebug::Printf("[WARNING %s failed %d]", __PRETTY_FUNCTION__, a);

/**
Debug macro to output test in 'verbose' detail mode
*/
#define LOG_VERBOSE1(a) if (gVerboseOutput) test.Printf(a);
#define LOG_VERBOSE2(a,b) if (gVerboseOutput) test.Printf(a, b);
#define LOG_VERBOSE3(a,b,c) if (gVerboseOutput) test.Printf(a, b, c);

#define LOG_STEPNAME(a) PrintStepName(a); 

/**
 Panic the framework
*
#define PANIC_FRAMEWORK(a) RDebug::Printf("<Framework died '%s' %d %s",\
    a, __LINE__, __FILE__); User::Panic(_LIT("Test F/W"), KErrUnknown);
*/	


#endif // DEBUGMACROS_H