qthighway/tests/auto/xqservice/ut_xqservicechannel/src/xqserviceipcclient_stub.cpp
changeset 18 1b485afba084
parent 16 19b186e43276
child 28 19321a443c34
equal deleted inserted replaced
16:19b186e43276 18:1b485afba084
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 *
       
     5 * This program is free software: you can redistribute it and/or modify
       
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     8 * 
       
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
       
    13 *
       
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not, 
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:                                                         
       
    19 *
       
    20 */
       
    21 
       
    22 /* THIS IS A XQServiceIpcClient STUB used only for UNIT TEST */
       
    23 
       
    24 #include "xqserviceipcclient.h"
       
    25 #include "ut_xqservicechannel_threadstorage.h"
       
    26 
       
    27 #include "xqservicechannel.h"
       
    28 
       
    29 XQServiceIpcClient::XQServiceIpcClient(
       
    30     const QString& ipcConName, bool isServer, bool isSync, XQServiceRequestCompletedAsync* rc,
       
    31     const void *userData)
       
    32     : QObject()
       
    33 {
       
    34 }
       
    35 
       
    36 /*
       
    37 void XQServiceIpcClient::init()
       
    38 {
       
    39 }
       
    40 */
       
    41 
       
    42 XQServiceIpcClient::~XQServiceIpcClient()
       
    43 {
       
    44 }
       
    45 
       
    46 bool XQServiceIpcClient::listen()
       
    47 {
       
    48     return !testStorage()->failConnect;
       
    49 }
       
    50 
       
    51 bool XQServiceIpcClient::connectToServer()
       
    52 {
       
    53     return !testStorage()->failConnect;
       
    54 }
       
    55 
       
    56 bool XQServiceIpcClient::handleRequest( ServiceIPCRequest */*aRequest*/ )
       
    57 {
       
    58     return true;
       
    59 }
       
    60 
       
    61 void XQServiceIpcClient::handleCancelRequest( ServiceIPCRequest* /*aRequest*/ )
       
    62 {
       
    63 }
       
    64 
       
    65 void XQServiceIpcClient::handleDeleteRequest( ServiceIPCRequest* /*aRequest*/ )
       
    66 {
       
    67 }
       
    68 
       
    69 bool XQServiceIpcClient::send
       
    70     (const QString& ch, const QString& msg, const QByteArray& data, QByteArray& retData, int cmd)
       
    71 {
       
    72     if (!testStorage()->failSend) {
       
    73         XQServiceChannel::sendLocally(ch, msg, data);
       
    74     }
       
    75 
       
    76     return !testStorage()->failSend;
       
    77 }
       
    78 
       
    79 bool XQServiceIpcClient::cancelPendingSend(const QString& channel)
       
    80 {
       
    81     return true;
       
    82 }
       
    83 
       
    84 void XQServiceIpcClient::disconnected()
       
    85 {
       
    86 }
       
    87 
       
    88 void XQServiceIpcClient::clientError(int error)
       
    89 {
       
    90 }
       
    91 
       
    92 void XQServiceIpcClient::readyRead()
       
    93 {
       
    94 }
       
    95 
       
    96 void XQServiceIpcClient::readDone()
       
    97 {
       
    98 }
       
    99