homescreensrv_plat/context_utility_api/tsrc/testbase/sitfunitutils.inl
branchRCL_3
changeset 14 15e4dd19031c
parent 12 502e5d91ad42
child 15 a0713522ab97
equal deleted inserted replaced
12:502e5d91ad42 14:15e4dd19031c
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  inline functions for the STIFUnit utils
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 template <class T>
       
    20 inline TBool AssertEquals(const T& aExpected, const T& aActual)
       
    21 /**
       
    22  * AssertEquals
       
    23  *
       
    24  * @prototype
       
    25  * @test
       
    26  *
       
    27  * @param aExpected - Expected result
       
    28  * @param aActual - Actual result
       
    29  * @return - True if equal
       
    30  */
       
    31 	{
       
    32 	if( aExpected==aActual )
       
    33 		{
       
    34 		return ETrue;
       
    35 		}
       
    36 	return EFalse;
       
    37 	}
       
    38 
       
    39 template <class T>
       
    40 inline TBool AssertNull(const T* aPtr)
       
    41 /**
       
    42  * AssertNull
       
    43  *
       
    44  * @prototype
       
    45  * @test
       
    46  *
       
    47  * @param aPtr - Pointer
       
    48  * @return - True if NULL
       
    49  */
       
    50 	{
       
    51 	if( aPtr==NULL )
       
    52 		{
       
    53 		return ETrue;
       
    54 		}
       
    55 	return EFalse;
       
    56 	}
       
    57 
       
    58 template <class T>
       
    59 inline TBool AssertSame(const T* aExpectedPtr, const T* aActualPtr)
       
    60 /**
       
    61  * AssertSame
       
    62  *
       
    63  * @prototype
       
    64  * @test
       
    65  *
       
    66  * @param aExpectedPtr - Expected pointer
       
    67  * @param aActualPtr - Actual pointer
       
    68  * @return - True if equal
       
    69  */
       
    70 	{
       
    71 	if( aExpectedPtr==aActualPtr )
       
    72 		{
       
    73 		return ETrue;
       
    74 		}
       
    75 	return EFalse;
       
    76 	}
       
    77 
       
    78 inline TBool AssertTrue(const TBool& aCondition)
       
    79 /**
       
    80  * AssertTrue
       
    81  *
       
    82  * @prototype
       
    83  * @test
       
    84  *
       
    85  * @param aCondition - Condition
       
    86  * @return - True if aCondition is true
       
    87  */
       
    88 	{
       
    89 	if( !aCondition )
       
    90 		{
       
    91 		return EFalse;
       
    92 		}
       
    93 	return ETrue;
       
    94 	}
       
    95 
       
    96 // End of File