os/ossrv/genericservices/taskscheduler/Test/TSUtils/TestUtils.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2004-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 "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 //
    15 
    16 #ifndef __TESTUTILS_H__
    17 #define __TESTUTILS_H__
    18 
    19 #include <e32base.h>
    20 #include <e32test.h>
    21 
    22 extern RTest TheTest;
    23 #define TEST(arg) TheTest(arg, __LINE__)
    24 #define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__)
    25 
    26 
    27 //Does "aValue == aExpected" and if it is not true - prints out an error message
    28 //with source line number and cancels the test
    29 void Check(TInt aValue, TInt aExpected, TInt aLine)
    30 	{
    31 	if(aValue != aExpected)
    32 		{
    33 		RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue);
    34 		TheTest(EFalse, aLine);
    35 		}
    36 	}
    37 #endif//__TESTUTILS_H__