Add copyright notices to tests
[profile/ivi/ofono-qt.git] / tests / test_ofonomessagewaiting.cpp
1 /*
2  * This file is part of ofono-qt
3  *
4  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5  *
6  * Contact: Alexander Kanavin <alexander.kanavin@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * version 2.1 as published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  */
23
24 #include <QtTest/QtTest>
25 #include <QtCore/QObject>
26
27 #include <ofonomessagewaiting.h>
28
29 #include <QtDebug>
30
31 class TestOfonoMessageWaiting : public QObject
32 {
33     Q_OBJECT
34
35 private slots:
36
37     void voicemailWaitingChanged(bool waiting)
38     {
39         qDebug() << "voicemailWaitingChanged" << waiting;
40     }
41
42     void voicemailMessageCountChanged(int count)
43     {
44         qDebug() << "voicemailMessageCountChanged" << count;
45     }
46
47     void voicemailMailboxNumberChanged(QString mailboxnumber)
48     {
49         qDebug() << "voicemailMailboxNumberChanged" << mailboxnumber;
50     }
51
52     void validityChanged(bool validity)
53     {
54         qDebug() << "ValidityChanged" << validity;
55     }
56
57     void initTestCase()
58     {
59         m = new OfonoMessageWaiting(QString(), this);
60         connect(m, SIGNAL(validityChanged(bool)), this, 
61                 SLOT(validityChanged(bool)));
62         connect(m, SIGNAL(voicemailWaitingChanged(bool)), this, 
63                 SLOT(voicemailWaitingChanged(bool)));
64         connect(m, SIGNAL(voicemailMessageCountChanged(int)), this, 
65                 SLOT(voicemailMessageCountChanged(int)));
66         connect(m, SIGNAL(voicemailMailboxNumberChanged(QString)), this, 
67                 SLOT(voicemailMailboxNumberChanged(QString)));
68     }
69
70     void testOfonoMessageWaiting()
71     {
72         qDebug() << "validity:" << m->isValid();
73         qDebug() << "voicemailWaiting():" << m->voicemailWaiting();
74         qDebug() << "voicemailMessageCount():" << m->voicemailMessageCount();
75         qDebug() << "voicemailMailboxNumber():" << m->voicemailMailboxNumber();
76         QTest::qWait(120000);
77     }
78
79
80     void cleanupTestCase()
81     {
82
83     }
84
85
86 private:
87     OfonoMessageWaiting *m;
88 };
89
90 QTEST_MAIN(TestOfonoMessageWaiting)
91 #include "test_ofonomessagewaiting.moc"