summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-05-04 18:20:07 -0700
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-05-08 09:04:23 +0000
commit3545ef41217e3ce4d1bea2b07793fa7a8c1058a6 (patch)
treeda1cccad6adaa1d20f8a45591dd43474895da84f /tests
parent9f4fb617e2ce865fd1afae0376c8a24d98e5aeed (diff)
Autotest: Check if this D-Bus library knows about file descriptors
Because if it doesn't, then calling dbus_type_is_fixed or is_basic may result in a failed assertion. process 16304: arguments to dbus_type_is_fixed() were incorrect, assertion "_dbus_type_is_valid (typecode) || typecode == DBUS_TYPE_INVALID" failed in file dbus-signature.c line 345. Change-Id: Idf715b895bac4d56b4afffff13db2ed71b1516a5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/dbus/qdbustype/tst_qdbustype.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
index e674b6d686..a054db877d 100644
--- a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
+++ b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
@@ -87,8 +87,19 @@ static void addFixedTypes()
QTest::newRow("int64") << DBUS_TYPE_INT64_AS_STRING << true << true;
QTest::newRow("uint64") << DBUS_TYPE_UINT64_AS_STRING << true << true;
QTest::newRow("double") << DBUS_TYPE_DOUBLE_AS_STRING << true << true;
+
#ifdef DBUS_TYPE_UNIX_FD_AS_STRING
- QTest::newRow("unixfd") << DBUS_TYPE_UNIX_FD_AS_STRING << true << true;
+# ifndef QT_LINKED_LIBDBUS
+ // We have got the macro from dbus_minimal_p.h, so we need to check if
+ // the library recognizes this as valid type first.
+ // The following function was added for Unix FD support, so if it is
+ // present, so is support for Unix FDs.
+ bool supportsUnixFds = qdbus_resolve_conditionally("dbus_connection_can_send_type");
+# else
+ bool supportsUnixFds = true;
+# endif
+ if (supportsUnixFds)
+ QTest::newRow("unixfd") << DBUS_TYPE_UNIX_FD_AS_STRING << true << true;
#endif
}