stdcpp/tsrc/BC/apps/BCException/src/BCExceptionBlocks.cpp
changeset 31 ce057bb09d0b
parent 0 e4d67989cc36
equal deleted inserted replaced
30:e20de85af2ee 31:ce057bb09d0b
       
     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 
       
    19 // [INCLUDE FILES] - do not remove
       
    20 #include <e32svr.h>
       
    21 #include <StifParser.h>
       
    22 #include <Stiftestinterface.h>
       
    23 #include "BCException.h"
       
    24 
       
    25 //Headers exported from exceptions API
       
    26 //#include <stl_rvct.h>
       
    27 //#include <exception.h>
       
    28 //#include <stdexcept>
       
    29 #include <exception>
       
    30 //#include <_range_errors.h>
       
    31 //#include <_exception.h>
       
    32 
       
    33 // EXTERNAL DATA STRUCTURES
       
    34 //extern  ?external_data;
       
    35 
       
    36 // EXTERNAL FUNCTION PROTOTYPES  
       
    37 //extern ?external_function( ?arg_type,?arg_type );
       
    38 
       
    39 // CONSTANTS
       
    40 //const ?type ?constant_var = ?constant;
       
    41 
       
    42 // MACROS
       
    43 //#define ?macro ?macro_def
       
    44 
       
    45 // LOCAL CONSTANTS AND MACROS
       
    46 //const ?type ?constant_var = ?constant;
       
    47 //#define ?macro_name ?macro_def
       
    48 
       
    49 // MODULE DATA STRUCTURES
       
    50 //enum ?declaration
       
    51 //typedef ?declaration
       
    52 
       
    53 // LOCAL FUNCTION PROTOTYPES
       
    54 //?type ?function_name( ?arg_type, ?arg_type );
       
    55 
       
    56 // FORWARD DECLARATIONS
       
    57 //class ?FORWARD_CLASSNAME;
       
    58 
       
    59 // ============================= LOCAL FUNCTIONS ===============================
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // ?function_name ?description.
       
    63 // ?description
       
    64 // Returns: ?value_1: ?description
       
    65 //          ?value_n: ?description_line1
       
    66 //                    ?description_line2
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 /*
       
    70 ?type ?function_name(
       
    71     ?arg_type arg,  // ?description
       
    72     ?arg_type arg)  // ?description
       
    73     {
       
    74 
       
    75     ?code  // ?comment
       
    76 
       
    77     // ?comment
       
    78     ?code
       
    79     }
       
    80 */
       
    81 
       
    82 // ============================ MEMBER FUNCTIONS ===============================
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // CBCException::Delete
       
    86 // Delete here all resources allocated and opened from test methods. 
       
    87 // Called from destructor. 
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 void CBCException::Delete() 
       
    91     {
       
    92 
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CBCException::RunMethodL
       
    97 // Run specified method. Contains also table of test mothods and their names.
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 TInt CBCException::RunMethodL( 
       
   101     CStifItemParser& aItem ) 
       
   102     {
       
   103 
       
   104     static TStifFunctionInfo const KFunctions[] =
       
   105         {  
       
   106         // Copy this line for every implemented function.
       
   107         // First string is the function name used in TestScripter script file.
       
   108         // Second is the actual implementation member function. 
       
   109         ENTRY( "TestAPI", CBCException::TestAPI ),
       
   110         //ADD NEW ENTRY HERE
       
   111         // [test cases entries] - Do not remove
       
   112 
       
   113         };
       
   114 
       
   115     const TInt count = sizeof( KFunctions ) / 
       
   116                         sizeof( TStifFunctionInfo );
       
   117 
       
   118     return RunInternalL( KFunctions, count, aItem );
       
   119 
       
   120     }
       
   121 
       
   122 // -----------------------------------------------------------------------------
       
   123 // CBCException::TestAPI
       
   124 // TestAPI test method function.
       
   125 // (other items were commented in a header).
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 TInt CBCException::TestAPI( CStifItemParser& aItem )
       
   129     {
       
   130 
       
   131     // Print to UI
       
   132     _LIT( KBCException, "BCException" );
       
   133     _LIT( KTestAPI, "In TestAPI" );
       
   134     TestModuleIf().Printf( 0, KBCException, KTestAPI );
       
   135     // Print to log file
       
   136     iLog->Log( KTestAPI );
       
   137 
       
   138 		_LIT( KResult, "No functions to be tested");
       
   139 		_LIT( KComment, "Exceptions API has passed");
       
   140     TestModuleIf().Printf( 0, KResult, KComment);
       
   141 
       
   142     return KErrNone;
       
   143 
       
   144     }
       
   145 
       
   146 // -----------------------------------------------------------------------------
       
   147 // CBCException::?member_function
       
   148 // ?implementation_description
       
   149 // (other items were commented in a header).
       
   150 // -----------------------------------------------------------------------------
       
   151 //
       
   152 /*
       
   153 TInt CBCException::?member_function(
       
   154    CItemParser& aItem )
       
   155    {
       
   156 
       
   157    ?code
       
   158 
       
   159    }
       
   160 */
       
   161 
       
   162 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   163 // None
       
   164 
       
   165 //  [End of File] - Do not remove