Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[connectionagent] dont disconnect if online. fixes JB#6946
add test
- Loading branch information
Lorn Potter
committed
Jun 6, 2013
1 parent
424c749
commit c3fdc19
Showing
4 changed files
with
97 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ TEMPLATE = subdirs | |
TEMPLATE += ordered | ||
|
||
SUBDIRS += tst_connectionagent_plugin | ||
SUBDIRS += tst_connectionagent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2013 Jolla Ltd | ||
** Contact: lorn.potter@jollamobile.com | ||
** | ||
** | ||
** $QT_BEGIN_LICENSE:LGPL$ | ||
** | ||
** GNU Lesser General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU Lesser | ||
** General Public License version 2.1 as published by the Free Software | ||
** Foundation and appearing in the file LICENSE.LGPL included in the | ||
** packaging of this file. Please review the following information to | ||
** ensure the GNU Lesser General Public License version 2.1 requirements | ||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** | ||
** $QT_END_LICENSE$ | ||
** | ||
****************************************************************************/ | ||
|
||
#include <QString> | ||
#include <QtTest> | ||
|
||
#include "../../../connd/qconnectionmanager.h" | ||
|
||
#include <networkmanager.h> | ||
#include <networktechnology.h> | ||
#include <networkservice.h> | ||
|
||
|
||
class Tst_connectionagent : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
Tst_connectionagent(); | ||
|
||
private Q_SLOTS: | ||
void testCase1(); | ||
}; | ||
|
||
Tst_connectionagent::Tst_connectionagent() | ||
{ | ||
NetworkManager *netman = NetworkManagerFactory::createInstance(); | ||
QString currentState = netman->state(); | ||
QConnectionManager::instance(); | ||
QVERIFY(currentState == netman->state()); | ||
} | ||
|
||
void Tst_connectionagent::testCase1() | ||
{ | ||
QVERIFY2(true, "Failure"); | ||
} | ||
|
||
QTEST_APPLESS_MAIN(Tst_connectionagent) | ||
|
||
#include "tst_connectionagent.moc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
QT += testlib dbus | ||
QT -= gui | ||
|
||
TARGET = tst_connectionagent | ||
CONFIG += console | ||
CONFIG -= app_bundle | ||
|
||
TEMPLATE = app | ||
|
||
DEFINES += SRCDIR=\\\"$$PWD/\\\" | ||
|
||
SOURCES += tst_connectionagent.cpp \ | ||
../../../connd/qconnectionmanager.cpp \ | ||
../../../connd/connadaptor.cpp | ||
|
||
HEADERS += \ | ||
../../../connd/qconnectionmanager.h \ | ||
../../../connd/connadaptor.h | ||
|
||
INCLUDEPATH += ../../../connd | ||
|
||
equals(QT_MAJOR_VERSION, 4): { | ||
PKGCONFIG += connman-qt4 | ||
LIBS += -lconnman-qt4 | ||
INCLUDEPATH += /usr/include/connman-qt | ||
} | ||
|
||
equals(QT_MAJOR_VERSION, 5): { | ||
PKGCONFIG += connman-qt5 | ||
LIBS += -lconnman-qt5 | ||
INCLUDEPATH += /usr/include/connman-qt5 | ||
} | ||
|