2 * This file is part of ofono-qt
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * Contact: Alexander Kanavin <alexander.kanavin@nokia.com>
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.
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.
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
24 #include <QtTest/QtTest>
25 #include <QtCore/QObject>
27 #include <ofonomodem.h>
31 class TestOfonoModem : public QObject
36 void validityChanged(bool validity)
38 qDebug() << "ValidityChanged" << validity;
39 qDebug() << "validity" << m->isValid() << "modemid" << m->modemId();
42 void modemIdChanged(QString modemId)
44 qDebug() << "ModemIdChanged" << modemId;
45 qDebug() << "validity" << m->isValid() << "modemid" << m->modemId();
48 void poweredChanged(bool powered)
50 qDebug() << "PoweredChanged" << powered;
53 void onlineChanged(bool online)
55 qDebug() << "OnlineChanged" << online;
58 void nameChanged(QString name)
60 qDebug() << "nameChanged" << name;
63 void manufacturerChanged(QString manufacturer)
65 qDebug() << "manufacturerChanged" << manufacturer;
68 void modelChanged(QString model)
70 qDebug() << "modelChanged" << model;
73 void revisionChanged(QString revision)
75 qDebug() << "revisionChanged" << revision;
78 void serialChanged(QString serial)
80 qDebug() << "serialChanged" << serial;
83 void featuresChanged(QStringList features)
85 qDebug() << "FeaturesChanged" << features;
88 void interfacesChanged(QStringList interfaces)
90 qDebug() << "InterfacesChanged" << interfaces;
95 m = new OfonoModem("/isimodem0", this);
96 // m = new OfonoModem(this);
97 connect(m, SIGNAL(validityChanged(bool)), this, SLOT(validityChanged(bool)));
98 connect(m, SIGNAL(modemIdChanged(QString)),
99 this, SLOT(modemIdChanged(QString)));
100 connect(m, SIGNAL(poweredChanged(bool)), this, SLOT(poweredChanged(bool)));
101 connect(m, SIGNAL(onlineChanged(bool)), this, SLOT(onlineChanged(bool)));
102 connect(m, SIGNAL(nameChanged(QString)),
103 this, SLOT(nameChanged(QString)));
104 connect(m, SIGNAL(manufacturerChanged(QString)),
105 this, SLOT(manufacturerChanged(QString)));
106 connect(m, SIGNAL(modelChanged(QString)),
107 this, SLOT(modelChanged(QString)));
108 connect(m, SIGNAL(revisionChanged(QString)),
109 this, SLOT(revisionChanged(QString)));
110 connect(m, SIGNAL(serialChanged(QString)),
111 this, SLOT(serialChanged(QString)));
112 connect(m, SIGNAL(featuresChanged(QStringList)), this, SLOT(featuresChanged(QStringList)));
113 connect(m, SIGNAL(interfacesChanged(QStringList)), this, SLOT(interfacesChanged(QStringList)));
116 void testOfonoModem()
118 qDebug() << "validity" << m->isValid() << "modemid" << m->modemId();
119 qDebug() << m->powered() << m->online() << m->manufacturer() << m->model() << m->revision() << m->serial() << m->features() << m->interfaces();
121 QTest::qWait(120000);
125 void cleanupTestCase()
135 QTEST_MAIN(TestOfonoModem)
136 #include "test_ofonomodem.moc"