Conditional compilation for Maemo 5 specific code
[irwi] / ut / ut_remotelistwidgetitem / ut_remotelistwidgetitem.cpp
1 #include <QSettings>
2 #include "ut_remotelistwidgetitem.h"
3 #include <QtTest>
4 #include "remotelistwidgetitem.h"
5 #include "remote.h"
6
7 void Ut_RemoteListWidgetItem::initTestCase()
8 {
9     subject = NULL;
10 }
11
12 void Ut_RemoteListWidgetItem::cleanupTestCase()
13 {
14 }
15
16 void Ut_RemoteListWidgetItem::init()
17 {
18     Remote* remote = new Remote("testname", "testmfg", 1, 2);
19     subject = new RemoteListWidgetItem(remote);
20 }
21
22 void Ut_RemoteListWidgetItem::cleanup()
23 {
24     if (subject != NULL) {
25         delete subject->remote();
26         delete subject;
27         subject = NULL;
28     }
29 }
30
31 void Ut_RemoteListWidgetItem::testData()
32 {
33     QCOMPARE(subject->data(0).toString(), QString("testname (1)"));
34     for (int i = 1; i < 16; ++i)
35     {
36         QCOMPARE(subject->data(i), QVariant());
37     }
38 }
39
40 QTEST_MAIN(Ut_RemoteListWidgetItem)
41
42