Initial commit
[profile/ivi/ofono-qt.git] / tests / test_ofonophonebook.cpp
1 #include <QtTest/QtTest>
2 #include <QtCore/QObject>
3
4 #include <ofonophonebook.h>
5
6 #include <QtDebug>
7
8 class TestOfonoPhonebook : public QObject
9 {
10     Q_OBJECT
11
12 private slots:
13     void validityChanged(bool validity)
14     {
15     qDebug() << "ValidityChanged" << validity;
16     }
17
18     void importComplete(bool success, QString entries)
19     {
20     qDebug() << "importComplete" << success << entries;
21     }
22
23     void initTestCase()
24     {
25 //      m = new OfonoPhonebook("/isimodem0", this);
26         m = new OfonoPhonebook(QString(), this);
27         connect(m, SIGNAL(validityChanged(bool)), this, SLOT(validityChanged(bool)));
28     connect(m, SIGNAL(importComplete(bool, QString)),
29             this, SLOT(importComplete(bool, QString)));
30     }
31
32     void testOfonoPhonebook()
33     {
34         qDebug() << "validity" << m->isValid();
35         m->requestImport();
36     QTest::qWait(120000);
37     }
38
39
40     void cleanupTestCase()
41     {
42
43     }
44
45
46 private:
47     OfonoPhonebook *m;
48 };
49
50 QTEST_MAIN(TestOfonoPhonebook)
51 #include "test_ofonophonebook.moc"