ce5d0c12ce881fb00dfc1911f2beac877b9f8e82
[profile/ivi/ofono-qt.git] / tests / test_ofonomessagewaiting.cpp
1 #include <QtTest/QtTest>
2 #include <QtCore/QObject>
3
4 #include <ofonomessagewaiting.h>
5
6 #include <QtDebug>
7
8 class TestOfonoMessageWaiting : public QObject
9 {
10     Q_OBJECT
11
12 private slots:
13
14     void voicemailWaitingChanged(bool waiting)
15     {
16         qDebug() << "voicemailWaitingChanged" << waiting;
17     }
18
19     void voicemailMessageCountChanged(int count)
20     {
21         qDebug() << "voicemailMessageCountChanged" << count;
22     }
23
24     void voicemailMailboxNumberChanged(QString mailboxnumber)
25     {
26         qDebug() << "voicemailMailboxNumberChanged" << mailboxnumber;
27     }
28
29     void validityChanged(bool validity)
30     {
31         qDebug() << "ValidityChanged" << validity;
32     }
33
34     void initTestCase()
35     {
36         m = new OfonoMessageWaiting(QString(), this);
37         connect(m, SIGNAL(validityChanged(bool)), this, 
38                 SLOT(validityChanged(bool)));
39         connect(m, SIGNAL(voicemailWaitingChanged(bool)), this, 
40                 SLOT(voicemailWaitingChanged(bool)));
41         connect(m, SIGNAL(voicemailMessageCountChanged(int)), this, 
42                 SLOT(voicemailMessageCountChanged(int)));
43         connect(m, SIGNAL(voicemailMailboxNumberChanged(QString)), this, 
44                 SLOT(voicemailMailboxNumberChanged(QString)));
45     }
46
47     void testOfonoMessageWaiting()
48     {
49         qDebug() << "validity:" << m->isValid();
50         qDebug() << "voicemailWaiting():" << m->voicemailWaiting();
51         qDebug() << "voicemailMessageCount():" << m->voicemailMessageCount();
52         qDebug() << "voicemailMailboxNumber():" << m->voicemailMailboxNumber();
53         QTest::qWait(120000);
54     }
55
56
57     void cleanupTestCase()
58     {
59
60     }
61
62
63 private:
64     OfonoMessageWaiting *m;
65 };
66
67 QTEST_MAIN(TestOfonoMessageWaiting)
68 #include "test_ofonomessagewaiting.moc"