diff -r 90fe62538f66 -r 5f281e37a2f5 controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemeutil/unittest_cpthemeutil.cpp --- a/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemeutil/unittest_cpthemeutil.cpp Tue Aug 31 15:15:28 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* 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: XENT-MV -* -* Description: unit tests for the CpThemePreview class from themeplugin -* -*/ - -#include - -#include -#include -#include -#include -#include "cpthemeutil.h" -#include "cpthemeinfo.h" - -class TestCpThemeUtil : public QObject -{ - Q_OBJECT - -private slots: - - void testMultiple(); - void testAvailableThemes(); - void testThemeDirectories(); - -}; - -void TestCpThemeUtil::testMultiple() -{ - QList > themes = HbThemeServices::availableThemes(); - - QPair pair; - - pair = themes.at(0); - - QString name = pair.first; - QString themePath = pair.second; - - QList themeList = CpThemeUtil::buildThemeList(); - - QCOMPARE(name, themeList.at(0).name()); - QCOMPARE(themePath, themeList.at(0).itemData()); - - CpThemeInfo *themeInfo = CpThemeUtil::buildThemeInfo(themePath, name); - QCOMPARE(name, themeInfo->name()); - QCOMPARE(themePath, themeInfo->itemData()); - - - //null test, making sure no crash happens. - QString defaultThemePath = CpThemeUtil::defaultTheme(); - - delete themeInfo; - themeInfo = 0; - -} -void TestCpThemeUtil::testAvailableThemes() -{ - QList > themes = HbThemeServices::availableThemes(); - QList > utilThemes = CpThemeUtil::availableThemes(); - - for(int i = 0; i < themes.size(); i++) { - QPairpair1; - QPairpair2; - - pair1 = themes.at(i); - pair2 = utilThemes.at(i); - QCOMPARE(pair1.first, pair2.first); - QCOMPARE(pair1.second, pair2.second); - } -} - -void TestCpThemeUtil::testThemeDirectories() -{ - QList themeList = CpThemeUtil::buildThemeList(); - QStringList themeDirs = CpThemeUtil::themeDirectories(themeList); - QVERIFY(themeList.size() > 0 && themeDirs.size() > 0); -} - -QTEST_MAIN(TestCpThemeUtil) -#include "unittest_cpthemeutil.moc" -