phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidgetsathandler/src/ut_infowidgetsathandler.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:31:11 +0300
changeset 27 2f8f8080a020
parent 22 6bb1b21d2484
permissions -rw-r--r--
Revision: 201015 Kit: 201018

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
#include "ut_infowidgetsathandler.h"
#define private public
#include "infowidgetsathandler.h"
#include "qtestmains60.h"

/*!
  UT_InfoWidgetSatHandler::UT_InfoWidgetSatHandler
 */
UT_InfoWidgetSatHandler::UT_InfoWidgetSatHandler() 
    : 
    m_satHandler(0)
{
    
}


/*!
  UT_InfoWidgetSatHandler::~UT_InfoWidgetSatHandler
 */
UT_InfoWidgetSatHandler::~UT_InfoWidgetSatHandler()
{
    delete m_satHandler;
}

/*!
  UT_InfoWidgetSatHandler::init
 */
void UT_InfoWidgetSatHandler::init()
{
    initialize();
    
    m_satHandler =  new InfoWidgetSatHandler();
    
    QVERIFY(verify());
}


/*!
  UT_InfoWidgetSatHandler::cleanup
 */
void UT_InfoWidgetSatHandler::cleanup()
{
    reset();
    
    delete m_satHandler;
    m_satHandler = 0;
}


/*!
  UT_InfoWidgetSatHandler::t_satDisplayText
 */
void UT_InfoWidgetSatHandler::t_satDisplayText()
{
    QString satDisplayText("satDisplayText");
    m_satHandler->setSatDisplayText(satDisplayText);
    QVERIFY(satDisplayText == m_satHandler->satDisplayText());
}


/*!
  UT_InfoWidgetSatHandler::t_setSatDisplayText
 */
void UT_InfoWidgetSatHandler::t_setSatDisplayText()
{
    QString satDisplayText("satDisplayText");
    m_satHandler->setSatDisplayText(satDisplayText);
    
    QVERIFY(satDisplayText == m_satHandler->satDisplayText());
}


/*!
  UT_InfoWidgetSatHandler::t_logCurrentInfo
 */
void UT_InfoWidgetSatHandler::t_logCurrentInfo()
{
    m_satHandler->logCurrentInfo();
    
    QVERIFY(verify());
}

void UT_InfoWidgetSatHandler::t_connect()
{
    //}else if (!connect && m_connected){
    m_satHandler->m_connected = 1;
    m_satHandler->connect(0);
    
        
    m_satHandler->m_connected = 1;
    m_satHandler->connect(1);
    
    //if(connect && !m_connected){
    m_satHandler->m_connected = 0;
    m_satHandler->connect(1);
    
    QVERIFY(verify());
}
void UT_InfoWidgetSatHandler::t_handleIdleModeTxtMessage()
{
    m_satHandler->m_connected = 0;
    m_satHandler->handleIdleModeTxtMessage(0);
    m_satHandler->m_connected = 1;
    m_satHandler->handleIdleModeTxtMessage(0);
    
    QVERIFY(verify());
}
void UT_InfoWidgetSatHandler::t_handleSatError()
{
    m_satHandler->handleSatError(1,1);
    
    QVERIFY(verify());
}
    

QTEST_MAIN_S60(UT_InfoWidgetSatHandler)