phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/src/ut_infowidgetsathandler.cpp
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 40 bab96b7ed1a4
parent 46 bc5a64e5bc3c
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
     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 #include "ut_infowidgetsathandler.h"
       
    18 #define private public
       
    19 #include "infowidgetsathandler.h"
       
    20 #include "qtestmains60.h"
       
    21 
       
    22 /*!
       
    23   UT_InfoWidgetSatHandler::UT_InfoWidgetSatHandler
       
    24  */
       
    25 UT_InfoWidgetSatHandler::UT_InfoWidgetSatHandler() 
       
    26     : 
       
    27     m_satHandler(0)
       
    28 {
       
    29     
       
    30 }
       
    31 
       
    32 
       
    33 /*!
       
    34   UT_InfoWidgetSatHandler::~UT_InfoWidgetSatHandler
       
    35  */
       
    36 UT_InfoWidgetSatHandler::~UT_InfoWidgetSatHandler()
       
    37 {
       
    38     delete m_satHandler;
       
    39 }
       
    40 
       
    41 /*!
       
    42   UT_InfoWidgetSatHandler::init
       
    43  */
       
    44 void UT_InfoWidgetSatHandler::init()
       
    45 {
       
    46     initialize();
       
    47     
       
    48     m_satHandler =  new InfoWidgetSatHandler();
       
    49     
       
    50     QVERIFY(verify());
       
    51 }
       
    52 
       
    53 
       
    54 /*!
       
    55   UT_InfoWidgetSatHandler::cleanup
       
    56  */
       
    57 void UT_InfoWidgetSatHandler::cleanup()
       
    58 {
       
    59     reset();
       
    60     
       
    61     delete m_satHandler;
       
    62     m_satHandler = 0;
       
    63 }
       
    64 
       
    65 
       
    66 /*!
       
    67   UT_InfoWidgetSatHandler::t_satDisplayText
       
    68  */
       
    69 void UT_InfoWidgetSatHandler::t_satDisplayText()
       
    70 {
       
    71     QString satDisplayText("satDisplayText");
       
    72     m_satHandler->setSatDisplayText(satDisplayText);
       
    73     QVERIFY(satDisplayText == m_satHandler->satDisplayText());
       
    74 }
       
    75 
       
    76 
       
    77 /*!
       
    78   UT_InfoWidgetSatHandler::t_setSatDisplayText
       
    79  */
       
    80 void UT_InfoWidgetSatHandler::t_setSatDisplayText()
       
    81 {
       
    82     QString satDisplayText("satDisplayText");
       
    83     m_satHandler->setSatDisplayText(satDisplayText);
       
    84     
       
    85     QVERIFY(satDisplayText == m_satHandler->satDisplayText());
       
    86 }
       
    87 
       
    88 
       
    89 /*!
       
    90   UT_InfoWidgetSatHandler::t_logCurrentInfo
       
    91  */
       
    92 void UT_InfoWidgetSatHandler::t_logCurrentInfo()
       
    93 {
       
    94     m_satHandler->logCurrentInfo();
       
    95     
       
    96     QVERIFY(verify());
       
    97 }
       
    98 
       
    99 void UT_InfoWidgetSatHandler::t_connect()
       
   100 {
       
   101     //}else if (!connect && m_connected){
       
   102     m_satHandler->m_connected = 1;
       
   103     m_satHandler->connect(0);
       
   104     
       
   105         
       
   106     m_satHandler->m_connected = 1;
       
   107     m_satHandler->connect(1);
       
   108     
       
   109     //if(connect && !m_connected){
       
   110     m_satHandler->m_connected = 0;
       
   111     m_satHandler->connect(1);
       
   112     
       
   113     QVERIFY(verify());
       
   114 }
       
   115 void UT_InfoWidgetSatHandler::t_handleIdleModeTxtMessage()
       
   116 {
       
   117     m_satHandler->m_connected = 0;
       
   118     m_satHandler->handleIdleModeTxtMessage(0);
       
   119     m_satHandler->m_connected = 1;
       
   120     m_satHandler->handleIdleModeTxtMessage(0);
       
   121     
       
   122     QVERIFY(verify());
       
   123 }
       
   124 void UT_InfoWidgetSatHandler::t_handleSatError()
       
   125 {
       
   126     m_satHandler->handleSatError(1,1);
       
   127     
       
   128     QVERIFY(verify());
       
   129 }
       
   130     
       
   131 
       
   132 QTEST_MAIN_S60(UT_InfoWidgetSatHandler)