stif/stif_plat/inc/StifUnitUtils.inl
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 template <class T>
       
    19 inline TBool AssertEquals(const T& aExpected, const T& aActual)
       
    20 /**
       
    21  * AssertEquals
       
    22  *
       
    23  * @prototype
       
    24  * @test
       
    25  *
       
    26  * @param aExpected - Expected result
       
    27  * @param aActual - Actual result
       
    28  * @return - True if equal
       
    29  */
       
    30 	{
       
    31 	if( aExpected==aActual )
       
    32 		{
       
    33 		return ETrue;
       
    34 		}
       
    35 	return EFalse;
       
    36 	}
       
    37 
       
    38 template <class T>
       
    39 inline TBool AssertNull(const T* aPtr)
       
    40 /**
       
    41  * AssertNull
       
    42  *
       
    43  * @prototype
       
    44  * @test
       
    45  *
       
    46  * @param aPtr - Pointer
       
    47  * @return - True if NULL
       
    48  */
       
    49 	{
       
    50 	if( aPtr==NULL )
       
    51 		{
       
    52 		return ETrue;
       
    53 		}
       
    54 	return EFalse;
       
    55 	}
       
    56 
       
    57 template <class T>
       
    58 inline TBool AssertSame(const T* aExpectedPtr, const T* aActualPtr)
       
    59 /**
       
    60  * AssertSame
       
    61  *
       
    62  * @prototype
       
    63  * @test
       
    64  *
       
    65  * @param aExpectedPtr - Expected pointer
       
    66  * @param aActualPtr - Actual pointer
       
    67  * @return - True if equal
       
    68  */
       
    69 	{
       
    70 	if( aExpectedPtr==aActualPtr )
       
    71 		{
       
    72 		return ETrue;
       
    73 		}
       
    74 	return EFalse;
       
    75 	}
       
    76 
       
    77 inline TBool AssertTrue(const TBool& aCondition)
       
    78 /**
       
    79  * AssertTrue
       
    80  *
       
    81  * @prototype
       
    82  * @test
       
    83  *
       
    84  * @param aCondition - Condition
       
    85  * @return - True if aCondition is true
       
    86  */
       
    87 	{
       
    88 	if( !aCondition )
       
    89 		{
       
    90 		return EFalse;
       
    91 		}
       
    92 	return ETrue;
       
    93 	}
       
    94 
       
    95 // End of File