btobexprofiles/obexsendservices/obexservicesendutils/internal/tsrc/ObexServiceSendUtilsApiTest/src/ObexServiceSendUtilsApiTestBlocks.cpp
changeset 32 19bd632b5100
equal deleted inserted replaced
31:a0ea99b6fa53 32:19bd632b5100
       
     1 /*
       
     2 * Copyright (c) 2002 - 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 the License "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES] - do not remove
       
    21 #include <e32svr.h>
       
    22 #include <StifParser.h>
       
    23 #include <Stiftestinterface.h>
       
    24 #include "ObexServiceSendUtilsApiTest.h"
       
    25 #include "BTServiceAPI.h"
       
    26 // EXTERNAL DATA STRUCTURES
       
    27 //extern  ?external_data;
       
    28 
       
    29 // EXTERNAL FUNCTION PROTOTYPES  
       
    30 //extern ?external_function( ?arg_type,?arg_type );
       
    31 
       
    32 // CONSTANTS
       
    33 //const ?type ?constant_var = ?constant;
       
    34 
       
    35 // MACROS
       
    36 //#define ?macro ?macro_def
       
    37 
       
    38 // LOCAL CONSTANTS AND MACROS
       
    39 //const ?type ?constant_var = ?constant;
       
    40 //#define ?macro_name ?macro_def
       
    41 
       
    42 // MODULE DATA STRUCTURES
       
    43 //enum ?declaration
       
    44 //typedef ?declaration
       
    45 
       
    46 // LOCAL FUNCTION PROTOTYPES
       
    47 //?type ?function_name( ?arg_type, ?arg_type );
       
    48 
       
    49 // FORWARD DECLARATIONS
       
    50 //class ?FORWARD_CLASSNAME;
       
    51 
       
    52 // ============================= LOCAL FUNCTIONS ===============================
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // ?function_name ?description.
       
    56 // ?description
       
    57 // Returns: ?value_1: ?description
       
    58 //          ?value_n: ?description_line1
       
    59 //                    ?description_line2
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 /*
       
    63 ?type ?function_name(
       
    64     ?arg_type arg,  // ?description
       
    65     ?arg_type arg)  // ?description
       
    66     {
       
    67 
       
    68     ?code  // ?comment
       
    69 
       
    70     // ?comment
       
    71     ?code
       
    72     }
       
    73 */
       
    74 
       
    75 // ============================ MEMBER FUNCTIONS ===============================
       
    76 
       
    77 // -----------------------------------------------------------------------------
       
    78 // CObexServiceSendUtilsApiTest::Delete
       
    79 // Delete here all resources allocated and opened from test methods. 
       
    80 // Called from destructor. 
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 void CObexServiceSendUtilsApiTest::Delete() 
       
    84     {
       
    85 
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CObexServiceSendUtilsApiTest::RunMethodL
       
    90 // Run specified method. Contains also table of test mothods and their names.
       
    91 // -----------------------------------------------------------------------------
       
    92 //
       
    93 TInt CObexServiceSendUtilsApiTest::RunMethodL( 
       
    94     CStifItemParser& aItem ) 
       
    95     {
       
    96 
       
    97     static TStifFunctionInfo const KFunctions[] =
       
    98         {  
       
    99         // Copy this line for every implemented function.
       
   100         // First string is the function name used in TestScripter script file.
       
   101         // Second is the actual implementation member function. 
       
   102         ENTRY( "StartService", CObexServiceSendUtilsApiTest::StartServiceL ),
       
   103         //ADD NEW ENTRY HERE
       
   104         // [test cases entries] - Do not remove
       
   105 
       
   106         };
       
   107 
       
   108     const TInt count = sizeof( KFunctions ) / 
       
   109                         sizeof( TStifFunctionInfo );
       
   110 
       
   111     return RunInternalL( KFunctions, count, aItem );
       
   112 
       
   113     }
       
   114 
       
   115 TInt CObexServiceSendUtilsApiTest::StartServiceL( CStifItemParser& aItem )
       
   116     {
       
   117 
       
   118       CBTServiceAPI* service = CBTServiceAPI::NewL();
       
   119       CleanupStack::PushL(service );
       
   120       STIF_ASSERT_NOT_NULL(service)
       
   121       
       
   122       CBTServiceParameterList* list = CBTServiceParameterList::NewL();
       
   123       iLog->Log(_L("CBTServiceParameterList::NewL"));
       
   124       CleanupStack::PushL(list);
       
   125       STIF_ASSERT_NOT_NULL(list)
       
   126 
       
   127       list->AddImageL(_L("e:\\testdata\\SmallPic.jpg"));
       
   128       iLog->Log(_L("list->AddImageL "));
       
   129       CleanupStack::Pop(list);
       
   130       
       
   131       TRAPD( err, service->StartSynchronousServiceL( EBTSendingService, list));
       
   132       iLog->Log(_L("service->StartServiceL result: %d"), err);
       
   133       CleanupStack::PopAndDestroy(1);
       
   134     return KErrNone;
       
   135 
       
   136     }
       
   137 
       
   138 // -----------------------------------------------------------------------------
       
   139 // CObexServiceSendUtilsApiTest::?member_function
       
   140 // ?implementation_description
       
   141 // (other items were commented in a header).
       
   142 // -----------------------------------------------------------------------------
       
   143 //
       
   144 /*
       
   145 TInt CObexServiceSendUtilsApiTest::?member_function(
       
   146    CItemParser& aItem )
       
   147    {
       
   148 
       
   149    ?code
       
   150 
       
   151    }
       
   152 */
       
   153 
       
   154 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   155 // None
       
   156 
       
   157 //  [End of File] - Do not remove