Autotest: test both libdbus-1 load failure and connection failure
Change-Id: I39cc61d0d59846ab8c23ffff14242294649c1a45 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>bb10
parent
9510d99f08
commit
0828d4e8ea
|
|
@ -10,6 +10,7 @@ SUBDIRS+=\
|
|||
qdbusconnection \
|
||||
qdbusconnection_no_app \
|
||||
qdbusconnection_no_bus \
|
||||
qdbusconnection_no_libdbus \
|
||||
qdbuscontext \
|
||||
qdbusinterface \
|
||||
qdbuslocalcalls \
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ public:
|
|||
tst_QDBusConnectionNoBus()
|
||||
{
|
||||
qputenv("DBUS_SESSION_BUS_ADDRESS", "unix:abstract=/tmp/does_not_exist");
|
||||
#ifdef SIMULATE_LOAD_FAIL
|
||||
qputenv("QT_SIMULATE_DBUS_LIBFAIL", "1");
|
||||
#endif
|
||||
}
|
||||
|
||||
private slots:
|
||||
|
|
@ -67,7 +69,7 @@ void tst_QDBusConnectionNoBus::connectToBus()
|
|||
|
||||
QDBusConnection con = QDBusConnection::sessionBus();
|
||||
|
||||
QVERIFY(true); // if we didn't crash here, the test passed :)
|
||||
QVERIFY(!con.isConnected()); // if we didn't crash here, the test passed :)
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_QDBusConnectionNoBus)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
CONFIG += testcase parallel_test
|
||||
TARGET = tst_qdbusconnection_no_libdbus
|
||||
QT = core dbus testlib
|
||||
DEFINES += SIMULATE_LOAD_FAIL
|
||||
SOURCES += ../qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
|
||||
Loading…
Reference in New Issue