testexecmdw/tef/tef/tefunit/test/src/ctestsuiteassert.cpp
branchRCL_3
changeset 3 9397a16b6eb8
parent 1 6edeef394eb7
equal deleted inserted replaced
1:6edeef394eb7 3:9397a16b6eb8
     1 /*
       
     2 * Copyright (c) 2005-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 
       
    19 
       
    20 /**
       
    21  @file CTestSuiteAssert.cpp
       
    22 */
       
    23 
       
    24 #include "ctestsuiteassert.h"
       
    25 
       
    26 void CTestSuiteAssert::SetupL()
       
    27 /**
       
    28  * SetupL
       
    29  */
       
    30 	{
       
    31 	}
       
    32 
       
    33 void CTestSuiteAssert::TearDownL()
       
    34 /**
       
    35  * TearDownL
       
    36  */
       
    37 	{
       
    38 	}
       
    39 
       
    40 void CTestSuiteAssert::TestAssertEquals()
       
    41 /**
       
    42  * TestAssertEquals
       
    43  */
       
    44 	{
       
    45 	INFO_PRINTF1(_L("Running SuiteA:AssertEquals"));
       
    46 	ASSERT_EQUALS( 5, 10 );
       
    47 	}
       
    48 
       
    49 void CTestSuiteAssert::TestAssertNull()
       
    50 /**
       
    51  * TestAssertNull
       
    52  */
       
    53 	{
       
    54 	INFO_PRINTF1(_L("Running SuiteA:AssertNull"));
       
    55 	CTestConfig* aPtr = NULL;
       
    56 	aPtr = &iConfig;
       
    57 	ASSERT_NULL( aPtr );
       
    58 	}
       
    59 
       
    60 void CTestSuiteAssert::TestAssertNotNull()
       
    61 /**
       
    62  * TestAssertNotNull
       
    63  */
       
    64 	{
       
    65 	INFO_PRINTF1(_L("Running SuiteA:AssertNotNull"));
       
    66 	CTestConfig* aPtr = NULL;
       
    67 	ASSERT_NOT_NULL( aPtr );
       
    68 	}
       
    69 
       
    70 void CTestSuiteAssert::TestAssertSame()
       
    71 /**
       
    72  * TestAssertSame
       
    73  */
       
    74 	{
       
    75 	INFO_PRINTF1(_L("Running SuiteA:AssertSame"));
       
    76 	CTestConfig* aPtr = NULL;
       
    77 	ASSERT_SAME( aPtr, &iConfig );
       
    78 	}
       
    79 
       
    80 void CTestSuiteAssert::TestAssertNotSame()
       
    81 /**
       
    82  * TestAssertNotSame
       
    83  */
       
    84 	{
       
    85 	INFO_PRINTF1(_L("Running SuiteA:AssertNotSame"));
       
    86 	ASSERT_NOT_SAME( &iConfig, &iConfig );
       
    87 	}
       
    88 
       
    89 void CTestSuiteAssert::TestAssertTrue()
       
    90 /**
       
    91  * TestAssertTrue
       
    92  */
       
    93 	{
       
    94 	INFO_PRINTF1(_L("Running SuiteA:AssertTrue"));
       
    95 	ASSERT_TRUE( EFalse );
       
    96 	}
       
    97 
       
    98 void CTestSuiteAssert::TestAssertFalse()
       
    99 /**
       
   100  * TestAssertFalse
       
   101  */
       
   102 	{
       
   103 	INFO_PRINTF1(_L("Running SuiteA:AssertFalse"));
       
   104 	ASSERT_FALSE( ETrue );
       
   105 	}
       
   106 
       
   107 CTestSuite* CTestSuiteAssert::CreateSuiteL( const TDesC& aName )
       
   108 /**
       
   109  * CreateSuiteL
       
   110  *
       
   111  * @param aName - Suite name
       
   112  * @return - Suite
       
   113  */
       
   114 	{
       
   115 	SUB_SUITE;
       
   116 #ifndef __GCCXML__
       
   117  	ADD_TEST_STEP( TestAssertEquals );
       
   118  	ADD_TEST_STEP( TestAssertNull );
       
   119  	ADD_TEST_STEP( TestAssertNotNull );
       
   120  	ADD_TEST_STEP( TestAssertSame );
       
   121  	ADD_TEST_STEP( TestAssertNotSame );
       
   122  	ADD_TEST_STEP( TestAssertTrue );
       
   123  	ADD_TEST_STEP( TestAssertFalse );
       
   124 #endif
       
   125 #ifdef __GCCXML__
       
   126  	ADD_TEST_STEP_CLASS( CTestSuiteAssert, TestAssertEquals );
       
   127  	ADD_TEST_STEP_CLASS( CTestSuiteAssert, TestAssertNull );
       
   128  	ADD_TEST_STEP_CLASS( CTestSuiteAssert, TestAssertNotNull );
       
   129  	ADD_TEST_STEP_CLASS( CTestSuiteAssert, TestAssertSame );
       
   130  	ADD_TEST_STEP_CLASS( CTestSuiteAssert, TestAssertNotSame );
       
   131  	ADD_TEST_STEP_CLASS( CTestSuiteAssert, TestAssertTrue );
       
   132  	ADD_TEST_STEP_CLASS( CTestSuiteAssert, TestAssertFalse );
       
   133 #endif	
       
   134  	END_SUITE;
       
   135 	}