profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/src/ProfileStifBlocks.cpp
branchRCL_3
changeset 19 cd54903d48da
parent 0 ca436256272f
equal deleted inserted replaced
18:b7fa36b488f8 19:cd54903d48da
       
     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: This file contains testclass implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 // [INCLUDE FILES] - do not remove
       
    19 #include <e32svr.h>
       
    20 #include <StifParser.h>
       
    21 #include <Stiftestinterface.h>
       
    22 #include "ProfileStif.h"
       
    23 #include <CProfileToneHandler.h>
       
    24 
       
    25 // EXTERNAL DATA STRUCTURES
       
    26 //extern  ?external_data;
       
    27 
       
    28 // EXTERNAL FUNCTION PROTOTYPES  
       
    29 //extern ?external_function( ?arg_type,?arg_type );
       
    30 
       
    31 // CONSTANTS
       
    32 //const ?type ?constant_var = ?constant;
       
    33 
       
    34 // MACROS
       
    35 //#define ?macro ?macro_def
       
    36 
       
    37 // LOCAL CONSTANTS AND MACROS
       
    38 //const ?type ?constant_var = ?constant;
       
    39 //#define ?macro_name ?macro_def
       
    40 
       
    41 // MODULE DATA STRUCTURES
       
    42 //enum ?declaration
       
    43 //typedef ?declaration
       
    44 
       
    45 // LOCAL FUNCTION PROTOTYPES
       
    46 //?type ?function_name( ?arg_type, ?arg_type );
       
    47 
       
    48 // FORWARD DECLARATIONS
       
    49 //class ?FORWARD_CLASSNAME;
       
    50 
       
    51 // ============================= LOCAL FUNCTIONS ===============================
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // ?function_name ?description.
       
    55 // ?description
       
    56 // Returns: ?value_1: ?description
       
    57 //          ?value_n: ?description_line1
       
    58 //                    ?description_line2
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 /*
       
    62 ?type ?function_name(
       
    63     ?arg_type arg,  // ?description
       
    64     ?arg_type arg)  // ?description
       
    65     {
       
    66 
       
    67     ?code  // ?comment
       
    68 
       
    69     // ?comment
       
    70     ?code
       
    71     }
       
    72 */
       
    73 
       
    74 // ============================ MEMBER FUNCTIONS ===============================
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CProfileStif::Delete
       
    78 // Delete here all resources allocated and opened from test methods. 
       
    79 // Called from destructor. 
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void CProfileStif::Delete() 
       
    83     {
       
    84 
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CProfileStif::RunMethodL
       
    89 // Run specified method. Contains also table of test mothods and their names.
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 TInt CProfileStif::RunMethodL( 
       
    93     CStifItemParser& aItem ) 
       
    94     {
       
    95 
       
    96     static TStifFunctionInfo const KFunctions[] =
       
    97         {  
       
    98         // Copy this line for every implemented function.
       
    99         // First string is the function name used in TestScripter script file.
       
   100         // Second is the actual implementation member function. 
       
   101         ENTRY( "NewLTestL", CProfileStif::NewLTestL ),
       
   102         ENTRY( "NewLCTestL", CProfileStif::NewLCTestL ),
       
   103         ENTRY( "SetActiveProfileRingingToneTestL", CProfileStif::SetActiveProfileRingingToneTestL ),
       
   104         ENTRY( "SetProfileToneTestL", CProfileStif::SetProfileToneTestL ),
       
   105         ENTRY( "SetToneForAllProfilesTestL", CProfileStif::SetToneForAllProfilesTestL ),
       
   106         ENTRY( "SetProfileToneNotCheckLTestL", CProfileStif::SetProfileToneNotCheckLTestL )
       
   107         //ADD NEW ENTRY HERE
       
   108         // [test cases entries] - Do not remove
       
   109 
       
   110         };
       
   111 
       
   112     const TInt count = sizeof( KFunctions ) / 
       
   113                         sizeof( TStifFunctionInfo );
       
   114 
       
   115     return RunInternalL( KFunctions, count, aItem );
       
   116 
       
   117     }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CProfileStif::ExampleL
       
   121 // Example test method function.
       
   122 // (other items were commented in a header).
       
   123 // -----------------------------------------------------------------------------
       
   124 //
       
   125 
       
   126 
       
   127 TInt CProfileStif::NewLTestL( CStifItemParser& aItem )
       
   128 	{
       
   129     CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
       
   130     CleanupStack::PushL( toneHandler );
       
   131     CleanupStack::PopAndDestroy(); // toneHandler
       
   132     return KErrNone;
       
   133 	}
       
   134 
       
   135 TInt CProfileStif::NewLCTestL( CStifItemParser& aItem )
       
   136 	{
       
   137     CProfileToneHandler* toneHandler = CProfileToneHandler::NewLC();
       
   138     CleanupStack::PopAndDestroy(); // toneHandler
       
   139     return KErrNone;
       
   140 	}
       
   141 
       
   142 TInt CProfileStif::SetActiveProfileRingingToneTestL( CStifItemParser& aItem )
       
   143 	{
       
   144 	TInt err = KErrNone;
       
   145 	CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
       
   146 	CleanupStack::PushL( toneHandler );
       
   147 	err = toneHandler->SetActiveProfileRingingToneL( KNullDesC );
       
   148 	CleanupStack::PopAndDestroy(); // toneHandler
       
   149 	return err;
       
   150 	}
       
   151 
       
   152 TInt CProfileStif::SetProfileToneTestL( CStifItemParser& aItem )
       
   153 	{
       
   154 	TInt err = KErrNone;
       
   155 	CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
       
   156 	CleanupStack::PushL( toneHandler );
       
   157 	err = toneHandler->SetProfileToneL( 0, EProfileRingingToneSetting, KNullDesC );
       
   158 	CleanupStack::PopAndDestroy(); // toneHandler
       
   159 	return err;
       
   160 	}
       
   161 
       
   162 TInt CProfileStif::SetToneForAllProfilesTestL( CStifItemParser& aItem )
       
   163 	{
       
   164 	TInt err = KErrNone;
       
   165 	CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
       
   166 	CleanupStack::PushL( toneHandler );
       
   167 	err = toneHandler->SetToneForAllProfilesL( EProfileRingingToneSetting, KNullDesC );
       
   168 	CleanupStack::PopAndDestroy(); // toneHandler
       
   169 	return err;
       
   170 	}
       
   171 
       
   172 TInt CProfileStif::SetProfileToneNotCheckLTestL( CStifItemParser& aItem )
       
   173 	{
       
   174 	TInt err = KErrNone;
       
   175 	CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
       
   176 	CleanupStack::PushL( toneHandler );
       
   177 	err = toneHandler->SetProfileToneNotCheckL(0, EProfileRingingToneSetting, KNullDesC );
       
   178 	CleanupStack::PopAndDestroy(); // toneHandler
       
   179 	return err;	
       
   180 	}
       
   181 
       
   182 // -----------------------------------------------------------------------------
       
   183 // CProfileStif::?member_function
       
   184 // ?implementation_description
       
   185 // (other items were commented in a header).
       
   186 // -----------------------------------------------------------------------------
       
   187 //
       
   188 /*
       
   189 TInt CProfileStif::?member_function(
       
   190    CItemParser& aItem )
       
   191    {
       
   192 
       
   193    ?code
       
   194 
       
   195    }
       
   196 */
       
   197 
       
   198 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   199 // None
       
   200 
       
   201 //  [End of File] - Do not remove