55
|
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 |
* test application for qt control panel public apis.
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "ut_cppluginloader.h"
|
|
19 |
#include "cppluginloader.h"
|
|
20 |
|
|
21 |
#include <QtTest/QtTest>
|
|
22 |
|
|
23 |
|
|
24 |
/*!
|
|
25 |
\class TestCpPluginLoader
|
|
26 |
\brief The TestCpPluginLoader class is designed for the unit testing for CpPluginLoader class.
|
|
27 |
This unit test is supported by QTest.
|
|
28 |
There are total 6 test cases in this unit.
|
|
29 |
*/
|
|
30 |
|
|
31 |
void TestCpPluginLoader::initTestCase()
|
|
32 |
{
|
|
33 |
}
|
|
34 |
|
|
35 |
void TestCpPluginLoader::cleanupTestCase()
|
|
36 |
{
|
|
37 |
QCoreApplication::processEvents();
|
|
38 |
}
|
|
39 |
|
|
40 |
/*!
|
|
41 |
* Test Case Description:\n
|
|
42 |
* 1. Fucntion Name: loadCpPluginInterface() \n
|
|
43 |
2. Function Descrition: \n
|
|
44 |
load a plugin file, which is derived from CpPluginInterface class.\n
|
|
45 |
3. Input Parameters: cpcfg file name. \n
|
|
46 |
4. Expected result: \n
|
|
47 |
case run without verify failed.\n
|
|
48 |
*/
|
|
49 |
void TestCpPluginLoader::testLoadCpPluginInterfaceWithCpcfgFilename()
|
|
50 |
{
|
|
51 |
CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("testplugin.cpcfg");
|
|
52 |
QVERIFY(plugin != 0);
|
|
53 |
}
|
|
54 |
|
|
55 |
/*!
|
|
56 |
* Test Case Description:\n
|
|
57 |
* 1. Fucntion Name: loadCpPluginInterface() \n
|
|
58 |
2. Function Descrition: \n
|
|
59 |
load a plugin file, which is derived from CpPluginInterface class.\n
|
|
60 |
3. Input Parameters: absolute path of cpcfg file name. \n
|
|
61 |
4. Expected result: \n
|
|
62 |
case run without verify failed.\n
|
|
63 |
*/
|
|
64 |
void TestCpPluginLoader::testLoadCpPluginInterfaceWithAbsoluteQtpluginPath()
|
|
65 |
{
|
|
66 |
CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("/resource/qt/plugins/controlpanel/testplugin.qtplugin");
|
|
67 |
QVERIFY(plugin != 0);
|
|
68 |
}
|
|
69 |
|
|
70 |
/*!
|
|
71 |
* Test Case Description:\n
|
|
72 |
* 1. Fucntion Name: loadCpPluginInterface() \n
|
|
73 |
2. Function Descrition: \n
|
|
74 |
load a plugin file, which is derived from CpPluginInterface class.\n
|
|
75 |
3. Input Parameters: qtplugin file name. \n
|
|
76 |
4. Expected result: \n
|
|
77 |
case run without verify failed.\n
|
|
78 |
*/
|
|
79 |
void TestCpPluginLoader::testLoadCpPluginInterfaceWithQtpluginFilename()
|
|
80 |
{
|
|
81 |
CpPluginInterface * plugin = CpPluginLoader::loadCpPluginInterface("testplugin.qtplugin");
|
|
82 |
QVERIFY(plugin != 0);
|
|
83 |
}
|
|
84 |
|
|
85 |
/*!
|
|
86 |
* Test Case Description:\n
|
|
87 |
* 1. Fucntion Name: loadCpLauncherInterface() \n
|
|
88 |
2. Function Descrition: \n
|
|
89 |
load a plugin file, which is derived from CpLauncherInterface class.\n
|
|
90 |
3. Input Parameters: defined cpcfg file name. \n
|
|
91 |
4. Expected result: \n
|
|
92 |
case run without verify failed.\n
|
|
93 |
*/
|
|
94 |
void TestCpPluginLoader::testLoadCpLauncherInterfaceWithCpcfgFilename()
|
|
95 |
{
|
|
96 |
CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("testplugin.cpcfg");
|
|
97 |
QVERIFY(plugin != 0);
|
|
98 |
}
|
|
99 |
|
|
100 |
/*!
|
|
101 |
* Test Case Description:\n
|
|
102 |
* 1. Fucntion Name: loadCpLauncherInterface() \n
|
|
103 |
2. Function Descrition: \n
|
|
104 |
load a plugin file, which is derived from CpLauncherInterface class.\n
|
|
105 |
3. Input Parameters: absolute path of a user defined qtplugin file name. \n
|
|
106 |
4. Expected result: \n
|
|
107 |
case run without verify failed.\n
|
|
108 |
*/
|
|
109 |
void TestCpPluginLoader::testLoadCpLauncherInterfaceWithAbsoluteQtpluginFilename()
|
|
110 |
{
|
|
111 |
CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("/resource/qt/plugins/controlpanel/testplugin.qtplugin");
|
|
112 |
QVERIFY(plugin != 0);
|
|
113 |
}
|
|
114 |
|
|
115 |
/*!
|
|
116 |
* Test Case Description:\n
|
|
117 |
* 1. Fucntion Name: loadCpLauncherInterface() \n
|
|
118 |
2. Function Descrition: \n
|
|
119 |
load a plugin file, which is derived from CpLauncherInterface class.\n
|
|
120 |
3. Input Parameters: qtplugin file name. \n
|
|
121 |
4. Expected result: \n
|
|
122 |
case run without verify failed.\n
|
|
123 |
*/
|
|
124 |
void TestCpPluginLoader::testLoadCpLauncherInterfaceWithQtpluginFilename()
|
|
125 |
{
|
|
126 |
CpLauncherInterface * plugin = CpPluginLoader::loadCpLauncherInterface("testplugin.qtplugin");
|
|
127 |
QVERIFY(plugin != 0);
|
|
128 |
}
|
|
129 |
|
|
130 |
QTEST_APPLESS_MAIN(TestCpPluginLoader)
|