sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // @internalComponent sl@0: // Collection of utility functions primarily assisting debuggers and maintainers. sl@0: // sl@0: // sl@0: sl@0: #ifndef DEBUGMACROS_H sl@0: #define DEBUGMACROS_H sl@0: sl@0: #include // RDebug class sl@0: #include "testengine.h" sl@0: sl@0: /** sl@0: Debug macro for serial port logging of function names and signatures sl@0: e.g. sl@0: void CMyClass::MyFunction (TInt aParam) sl@0: */ sl@0: #define LOG_FUNC if (gVerboseOutput) RDebug::Printf(" %s", __PRETTY_FUNCTION__); sl@0: sl@0: const TInt KErrAssertionInternal = 3; sl@0: sl@0: #define TEST_ASSERTION(a,b) if (!(a)) {test.Printf(_L("ASSERTION FAILED!\n line %d file %S.\n"), \ sl@0: __LINE__, __FILE__); test.Printf(b); \ sl@0: __ASSERT_ALWAYS(a, User::Panic(_L("Test F/W Err"), KErrAssertionInternal));}; sl@0: sl@0: sl@0: #define LOG_FUNCERROR(a) RDebug::Printf("[WARNING %s failed %d]", __PRETTY_FUNCTION__, a); sl@0: sl@0: /** sl@0: Debug macro to output test in 'verbose' detail mode sl@0: */ sl@0: #define LOG_VERBOSE1(a) if (gVerboseOutput) test.Printf(a); sl@0: #define LOG_VERBOSE2(a,b) if (gVerboseOutput) test.Printf(a, b); sl@0: #define LOG_VERBOSE3(a,b,c) if (gVerboseOutput) test.Printf(a, b, c); sl@0: sl@0: #define LOG_STEPNAME(a) PrintStepName(a); sl@0: sl@0: /** sl@0: Panic the framework sl@0: * sl@0: #define PANIC_FRAMEWORK(a) RDebug::Printf("