diff -r c18f9fa7f42e -r 640d30f4fb64 phonebookengines/cntsimutility/tsrc/ut_cntsimutility/ut_cntsimutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookengines/cntsimutility/tsrc/ut_cntsimutility/ut_cntsimutility.cpp Fri Oct 15 12:24:46 2010 +0300 @@ -0,0 +1,263 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +#ifdef SYMBIANSIM_BACKEND_USE_ETEL_TESTSERVER +#include +#else +#include +#endif +#include +#include "ut_cntsimutility.h" +#include "cntsimutility.h" + +bool TestCntSimUtility::returnErrorInStub_1 = false; +bool TestCntSimUtility::returnErrorInStub_2 = false; + + +TestCntSimUtility::TestCntSimUtility() : +m_SimStore(0) +{ + +} + +TestCntSimUtility::~TestCntSimUtility() +{ + +} + +void TestCntSimUtility::initTestCase() +{ + + int error = KErrNone; + + // remove all contacts +} + +void TestCntSimUtility::cleanupTestCase() +{ + + delete m_SimStore; + m_SimStore = 0; +} + +void TestCntSimUtility::TestStoreCreation() +{ + +} + +void TestCntSimUtility::TestGetSimInfo() +{ + // ok case + TestCntSimUtility::returnErrorInStub_1 = false; + int error = KErrNotSupported; + m_SimStore = new CntSimUtility(CntSimUtility::AdnStore, error); + error = KErrNotSupported; + CntSimUtility::SimInfo simInformation_adn = m_SimStore->getSimInfo(error); + QVERIFY(KErrNone == error); + outputSimInfo(simInformation_adn); + + // error case + TestCntSimUtility::returnErrorInStub_1 = true; + simInformation_adn = m_SimStore->getSimInfo(error); + QVERIFY(KErrNone == KErrGeneral); + + +} +void TestCntSimUtility::outputSimInfo(CntSimUtility::SimInfo &results) + { + return; + qDebug()<< "SIMUTILITY:Totalentries = "<< results.totalEntries; + qDebug()<< "SIMUTILITY:usedEntries = "<< results.usedEntries ; + qDebug()<< "SIMUTILITY:maxNumLength = "<< results.maxNumLength; + qDebug()<< "SIMUTILITY:maxTextLength = "<< results.maxTextLength; + qDebug()<< "SIMUTILITY:maxSecondNames = "<< results.maxSecondNames; + qDebug()<< "SIMUTILITY:maxTextLengthSecondName = "<< results.maxTextLengthSecondName ; + qDebug()<< "SIMUTILITY:maxAdditionalNumbers = "<< results.maxAdditionalNumbers ; + qDebug()<< "SIMUTILITY:maxNumLengthAdditionalNumber = "<< results.maxNumLengthAdditionalNumber; + qDebug()<< "SIMUTILITY:maxTextLengthAdditionalNumber = "<< results.maxTextLengthAdditionalNumber; + qDebug()<< "SIMUTILITY:maxGroupNames = "<< results.maxGroupNames ; + qDebug()<< "SIMUTILITY:maxTextLengthGroupName = "<