aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test/paymentservertests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/test/paymentservertests.cpp')
-rw-r--r--src/qt/test/paymentservertests.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp
index b8f2cc65cb..7dee7a9cda 100644
--- a/src/qt/test/paymentservertests.cpp
+++ b/src/qt/test/paymentservertests.cpp
@@ -7,12 +7,9 @@
#include <openssl/x509.h>
#include <openssl/x509_vfy.h>
-#include <QCoreApplication>
-#include <QDebug>
+
#include <QFileOpenEvent>
#include <QTemporaryFile>
-#include <QVariant>
-
X509 *parse_b64der_cert(const char* cert_data)
{
@@ -41,9 +38,14 @@ static SendCoinsRecipient handleRequest(PaymentServer* server, std::vector<unsig
f.write((const char*)&data[0], data.size());
f.close();
- // Create a FileOpenEvent and send it directly to the server's event filter:
+ // Create a QObject, install event filter from PaymentServer
+ // and send a file open event to the object
+ QObject object;
+ object.installEventFilter(server);
QFileOpenEvent event(f.fileName());
- server->eventFilter(NULL, &event);
+ // If sending the event fails, this will cause sigCatcher to be empty,
+ // which will lead to a test failure anyway.
+ QCoreApplication::sendEvent(&object, &event);
QObject::disconnect(server, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)),
&sigCatcher, SLOT(getRecipient(SendCoinsRecipient)));