mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-04 00:05:25 +08:00
qt 6.5.1 original
This commit is contained in:
0
tests/auto/dbus/qdbusconnection_spyhook/BLACKLIST
Normal file
0
tests/auto/dbus/qdbusconnection_spyhook/BLACKLIST
Normal file
16
tests/auto/dbus/qdbusconnection_spyhook/CMakeLists.txt
Normal file
16
tests/auto/dbus/qdbusconnection_spyhook/CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## tst_qdbusconnection_spyhook Test:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_test(tst_qdbusconnection_spyhook
|
||||
SOURCES
|
||||
../qdbusconnection/tst_qdbusconnection.h
|
||||
tst_qdbusconnection_spyhook.cpp
|
||||
DEFINES
|
||||
tst_QDBusConnection=tst_QDBusConnection_SpyHook
|
||||
LIBRARIES
|
||||
Qt::DBus
|
||||
)
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2016 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QtDBus/QDBusMessage>
|
||||
|
||||
#define HAS_HOOKSETUPFUNCTION 1
|
||||
static void hookSetupFunction();
|
||||
|
||||
// Ugly hack, look away
|
||||
#include "../qdbusconnection/tst_qdbusconnection.cpp"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
extern Q_DBUS_EXPORT void qDBusAddSpyHook(void (*Hook)(const QDBusMessage&));
|
||||
QT_END_NAMESPACE
|
||||
|
||||
static void hookFunction(const QDBusMessage &)
|
||||
{
|
||||
// qDebug() << "hook called";
|
||||
++tst_QDBusConnection::hookCallCount;
|
||||
}
|
||||
|
||||
static void hookSetupFunction()
|
||||
{
|
||||
QT_PREPEND_NAMESPACE(qDBusAddSpyHook)(hookFunction);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QDBusConnection_SpyHook)
|
Reference in New Issue
Block a user