profilesservices/ProfileEngine/tsrc/public/basic/EngineMdlTest/src/T_CProfileChangeNotifyHandler.cpp
changeset 0 8c5d936e5675
child 8 f62c3a3d66b8
equal deleted inserted replaced
-1:000000000000 0:8c5d936e5675
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Implementation of the T_CProfileChangeNotifyHandler test class.
       
    15 *
       
    16 */
       
    17 
       
    18 ////////////////////////////////////////////////////////////////////////
       
    19 // T_CProfileChangeNotifyHandler.cpp
       
    20 //
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32math.h>
       
    24 #include <e32svr.h>
       
    25 
       
    26 #include <EUnitMacros.h>
       
    27 #include <TEUnitAssertionInfo.h>
       
    28 
       
    29 #include <CProfileChangeNotifyHandler.h>
       
    30 
       
    31 #include "T_ProfileTestTools.h"
       
    32 #include <centralrepository.h>
       
    33 #include <e32property.h>
       
    34 #include <ProfileEngineSDKCRKeys.h>
       
    35 #include <MProfileEngineExtended.h>
       
    36 #include <MProfileExtended.h>
       
    37 #include <TProfileToneSettings.h>
       
    38 #include <MProfileTones.h>
       
    39 #include "MProfileSetTones.h"
       
    40 #include "ProfileEnginePrivatePSKeys.h"
       
    41 
       
    42 // the header for the tested class
       
    43 #include "T_CProfileChangeNotifyHandler.h"
       
    44 
       
    45 //CONSTS
       
    46 //#define PROFILE_TEST_RUN_ALLOC
       
    47 
       
    48 
       
    49 // create the testing class
       
    50 T_CProfileChangeNotifyHandler* T_CProfileChangeNotifyHandler::NewLC()
       
    51     {
       
    52     T_CProfileChangeNotifyHandler* self = new(ELeave) T_CProfileChangeNotifyHandler;
       
    53 
       
    54     CleanupStack::PushL( self );
       
    55     // need to generate the table, so call base classes
       
    56     // second phase constructor
       
    57     self->ConstructL();
       
    58     return self;
       
    59     }
       
    60 
       
    61 void T_CProfileChangeNotifyHandler::ConstructL()
       
    62     {
       
    63     CEUnitTestSuiteClass::ConstructL();
       
    64     }
       
    65 
       
    66 T_CProfileChangeNotifyHandler::~T_CProfileChangeNotifyHandler()
       
    67     {
       
    68     delete iObserver;
       
    69     }
       
    70 
       
    71 /**
       
    72  * Assistance methods
       
    73  */
       
    74 
       
    75 
       
    76 /**
       
    77  * Setup
       
    78  */
       
    79 void T_CProfileChangeNotifyHandler::EmptySetupL()
       
    80     {
       
    81     }
       
    82 
       
    83 
       
    84 
       
    85 void T_CProfileChangeNotifyHandler::SetupL()
       
    86     {
       
    87     iObserver = CTestObserver::NewL();
       
    88     }
       
    89 
       
    90 
       
    91 
       
    92 /**
       
    93  * Teardown
       
    94  */
       
    95 void T_CProfileChangeNotifyHandler::EmptyTeardown()
       
    96     {
       
    97 
       
    98     }
       
    99 
       
   100 void T_CProfileChangeNotifyHandler::Teardown()
       
   101     {
       
   102     delete iObserver;
       
   103     iObserver = NULL;
       
   104     }
       
   105 
       
   106 /**
       
   107  * Tests
       
   108  */
       
   109 
       
   110 void T_CProfileChangeNotifyHandler::CreateTestL()
       
   111     {
       
   112     CProfileChangeNotifyHandler* handler = CProfileChangeNotifyHandler::NewL( iObserver );
       
   113     EUNIT_ASSERT( handler );
       
   114     delete handler;
       
   115     }
       
   116 
       
   117 
       
   118 // Test case table for this test suite class
       
   119 EUNIT_BEGIN_TEST_TABLE( T_CProfileChangeNotifyHandler, "T_CProfileChangeNotifyHandler test suite", "MODULE" )
       
   120 
       
   121     EUNIT_TESTCASE("Create test ", SetupL, CreateTestL, Teardown)
       
   122 
       
   123 EUNIT_END_TESTCASE_TABLE
       
   124 
       
   125 //  End of File