testexecfw/symbianunittestfw/sutfw/sutfwcore/sutfwframework/tsrc/src/ut_symbianunittestsuite.cpp
changeset 0 3e07fef1e154
child 1 bbd31066657e
equal deleted inserted replaced
-1:000000000000 0:3e07fef1e154
       
     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 #include "ut_symbianunittestsuite.h"
       
    19 #include "symbianunittestsuite.h"
       
    20 #include <symbianunittestmacros.h>
       
    21 
       
    22 _LIT( KTestSuiteName, "TestSuite" );
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 UT_CSymbianUnitTestSuite* UT_CSymbianUnitTestSuite::NewL()
       
    29     {
       
    30     UT_CSymbianUnitTestSuite* self = UT_CSymbianUnitTestSuite::NewLC(); 
       
    31     CleanupStack::Pop( self );
       
    32     return self;
       
    33     }
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 //
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 UT_CSymbianUnitTestSuite* UT_CSymbianUnitTestSuite::NewLC()
       
    40     {
       
    41     UT_CSymbianUnitTestSuite* self = 
       
    42         new( ELeave )UT_CSymbianUnitTestSuite();
       
    43     CleanupStack::PushL( self );
       
    44     self->ConstructL();
       
    45     return self;
       
    46     }
       
    47 
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 UT_CSymbianUnitTestSuite::UT_CSymbianUnitTestSuite()
       
    53     {
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 void UT_CSymbianUnitTestSuite::ConstructL()
       
    61     {
       
    62     BASE_CONSTRUCT
       
    63     ADD_SUT( UT_NameL )
       
    64     ADD_SUT( UT_AddL )
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 //
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 UT_CSymbianUnitTestSuite::~UT_CSymbianUnitTestSuite()
       
    72     {
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 void UT_CSymbianUnitTestSuite::SetupL()
       
    80     {
       
    81     iUnitTestSuite = CSymbianUnitTestSuite::NewL( KTestSuiteName );
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 //
       
    86 // ---------------------------------------------------------------------------
       
    87 //
       
    88 void UT_CSymbianUnitTestSuite::Teardown()
       
    89     {
       
    90     delete iUnitTestSuite;
       
    91     iUnitTestSuite = NULL;
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 //
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 void UT_CSymbianUnitTestSuite::UT_NameL()
       
    99     {
       
   100     SUT_ASSERT_EQUALS( KTestSuiteName, iUnitTestSuite->Name() )
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 void UT_CSymbianUnitTestSuite::UT_AddL()
       
   108     {
       
   109     SUT_ASSERT_EQUALS( 0, iUnitTestSuite->TestCaseCount() )
       
   110 
       
   111     UT_CSymbianUnitTestSuite* thisTest = UT_CSymbianUnitTestSuite::NewLC();
       
   112     iUnitTestSuite->AddL( thisTest );
       
   113     CleanupStack::Pop( thisTest );
       
   114     SUT_ASSERT_EQUALS( 
       
   115         thisTest->TestCaseCount(), iUnitTestSuite->TestCaseCount() )
       
   116     }