From cf4b413fa4a81dbfaaaf50cb52f92ecc0d3c3f2a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 9 Dec 2014 14:16:33 -0800 Subject: Make QtDBus unit tests compile with runtime dbus-1 too There's a change in Qt 5.4.0 that makes Qt compile with its own set of D-Bus headers, which means QT_CFLAGS_DBUS may be empty. Thus, we can't compile or link if we're using the actual libdbus-1 API to build the test. This commit makes these unit tests use the same dynamic loading mechanism. Change-Id: I56b2a7320086ef88793f6552cb54ca6224010451 Reviewed-by: Simon Hausmann --- tests/benchmarks/dbus/qdbustype/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/benchmarks/dbus/qdbustype/main.cpp') diff --git a/tests/benchmarks/dbus/qdbustype/main.cpp b/tests/benchmarks/dbus/qdbustype/main.cpp index 4723ed1b97..ae7eb6582a 100644 --- a/tests/benchmarks/dbus/qdbustype/main.cpp +++ b/tests/benchmarks/dbus/qdbustype/main.cpp @@ -35,8 +35,11 @@ #include #include +#include -#include +DEFINEFUNC(dbus_bool_t, dbus_signature_validate, (const char *signature, + DBusError *error), + (signature, error), return) class tst_QDBusType: public QObject { @@ -85,9 +88,9 @@ void tst_QDBusType::benchmarkSignature() bool result; if (useNative) { - dbus_signature_validate(data.toLatin1(), 0); + q_dbus_signature_validate(data.toLatin1(), 0); QBENCHMARK { - result = dbus_signature_validate(data.toLatin1(), 0); + result = q_dbus_signature_validate(data.toLatin1(), 0); } } else { QDBusUtil::isValidSignature(data); -- cgit v1.2.3