wlanutilities/wlanqtutilities/tsrc/stubs/wlanqtutilsesockstub.cpp
changeset 31 e8f4211554fb
equal deleted inserted replaced
30:ab513c8439db 31:e8f4211554fb
       
     1 /*
       
     2 * Copyright (c) 2009-2010 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 * This is a source file for esock library stub functions
       
    16 */
       
    17 
       
    18 #include <es_sock.h>
       
    19 
       
    20 #ifdef __WINS__
       
    21 
       
    22 #ifdef WLANQTUTILS_T_WLANQTUTILS_UT_FLAG
       
    23 
       
    24 // ----------------------------------------------
       
    25 // Stub functions for esock library, used in UT
       
    26 // ----------------------------------------------
       
    27 
       
    28 #include "wlanqtutilstestcontext.h"
       
    29 
       
    30 extern WlanQtUtilsTestContext testContext;
       
    31 
       
    32 /**
       
    33  * Returns value from test context.
       
    34  * 
       
    35  * TConnPref value cannot be verified easily because the real value passed to the function is
       
    36  * TCommDbConnPref. Dynamic cast from TConnPref to TCommDbConnPref does not work because
       
    37  * TConnPref does not have virtual functions which means that type information for the 
       
    38  * class hierarchy is not created by the compiler.
       
    39  */
       
    40 void RConnection::Start(class TConnPref &, class TRequestStatus &aStatus)
       
    41 {
       
    42     User::RequestComplete(&aStatus, testContext.esock_.startRetValue_);
       
    43 }
       
    44 
       
    45 #else // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG
       
    46 
       
    47 // ----------------------------------------------------
       
    48 // Stub functions for esock library, used in emulator
       
    49 // ----------------------------------------------------
       
    50 
       
    51 /**
       
    52  * Return always success in emulator.
       
    53  */
       
    54 void RConnection::Start(class TConnPref &, class TRequestStatus &aStatus)
       
    55 {
       
    56     User::RequestComplete(&aStatus, KErrNone);
       
    57 }
       
    58 
       
    59 #endif // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG
       
    60 #endif // __WINS__