79d7492c044c85b96909478d34d108e91d77e183
[profile/ivi/ofono-qt.git] / tests / test_ofonointerface.cpp
1 #include <QtTest/QtTest>
2 #include <QtCore/QObject>
3
4 #include <ofonointerface.h>
5
6 #include <QtDebug>
7
8 class TestOfonoInterface : public QObject
9 {
10     Q_OBJECT
11
12 private slots:
13
14     void onPropertyChanged(const QString& name, const QVariant& property)
15     {
16     qDebug() << name << property;
17     qDebug () << oi->properties();
18     }
19
20     void initTestCase()
21     {
22         oi = new OfonoInterface("/isimodem1", "org.ofono.Modem", OfonoInterface::GetAllOnStartup, this);
23         connect(oi, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(onPropertyChanged(const QString&, const QVariant&)));
24     }
25
26     void testOfonoInterface()
27     {
28     oi->setProperty("Online", qVariantFromValue(true));
29     QTest::qWait(30000);
30 //    qDebug() << oi->properties();
31     }
32
33
34     void cleanupTestCase()
35     {
36
37     }
38
39
40 private:
41     OfonoInterface *oi;
42 };
43
44 QTEST_MAIN(TestOfonoInterface)
45 #include "test_ofonointerface.moc"