telepathy-qt: Fix TestDBusProxyFactory::testDropRefs

David Edmundson davidedmundson at kemper.freedesktop.org
Mon Jan 27 15:11:49 PST 2014


Module: telepathy-qt
Branch: master
Commit: d6435eb0c335bab46d33d727560e2732bcd203aa
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=d6435eb0c335bab46d33d727560e2732bcd203aa

Author: Martin Kampas <martin.kampas at tieto.com>
Date:   Tue Nov 12 08:09:22 2013 +0100

Fix TestDBusProxyFactory::testDropRefs

(Hopefully) prevent getting the new proxy instantiated on the very same
address.

Reviewed-by: David Edmundson <davidedmundson at kde.org>

---

 tests/dbus/dbus-proxy-factory.cpp |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/dbus/dbus-proxy-factory.cpp b/tests/dbus/dbus-proxy-factory.cpp
index 67c8ab5..8596ea9 100644
--- a/tests/dbus/dbus-proxy-factory.cpp
+++ b/tests/dbus/dbus-proxy-factory.cpp
@@ -1,4 +1,5 @@
 #include <QtCore/QDebug>
+#include <QtCore/QScopedPointer>
 #include <QtCore/QTimer>
 #include <QtDBus/QtDBus>
 #include <QtTest/QtTest>
@@ -222,6 +223,9 @@ void TestDBusProxyFactory::testDropRefs()
     Connection *firstPtr = firstProxy.data();
     firstProxy.reset();
 
+    // Hopefully this prevents getting the new proxy instantiated on the very same address
+    QScopedPointer<char, QScopedPointerArrayDeleter<char> > hole(new char[sizeof(Connection)]);
+
     PendingReady *different = mFactory->proxy(mConnName1, mConnPath1,
             ChannelFactory::create(QDBusConnection::sessionBus()),
             ContactFactory::create());



More information about the telepathy-commits mailing list