From 00dd7943754b690221a6414694ee68df836858d9 Mon Sep 17 00:00:00 2001 From: Wiebe Cazemier Date: Tue, 15 Jun 2021 16:05:56 +0200 Subject: [PATCH] Fix tests --- FlashMQTests/FlashMQTests.pro | 2 ++ FlashMQTests/mainappthread.cpp | 1 + mainapp.h | 4 ++++ 3 files changed, 7 insertions(+), 0 deletions(-) diff --git a/FlashMQTests/FlashMQTests.pro b/FlashMQTests/FlashMQTests.pro index 0a0aefa..1c48319 100644 --- a/FlashMQTests/FlashMQTests.pro +++ b/FlashMQTests/FlashMQTests.pro @@ -41,6 +41,7 @@ SOURCES += tst_maintests.cpp \ ../evpencodectxmanager.cpp \ ../acltree.cpp \ ../threadlocalutils.cpp \ + ../flashmq_plugin.cpp \ mainappthread.cpp \ twoclienttestcontext.cpp @@ -75,6 +76,7 @@ HEADERS += \ ../evpencodectxmanager.h \ ../acltree.h \ ../threadlocalutils.h \ + ../flashmq_plugin.h \ mainappthread.h \ twoclienttestcontext.h diff --git a/FlashMQTests/mainappthread.cpp b/FlashMQTests/mainappthread.cpp index ff53916..e4dd29d 100644 --- a/FlashMQTests/mainappthread.cpp +++ b/FlashMQTests/mainappthread.cpp @@ -21,6 +21,7 @@ MainAppThread::MainAppThread(QObject *parent) : QThread(parent) { MainApp::initMainApp(1, nullptr); appInstance = MainApp::getMainApp(); + appInstance->settings->allowAnonymous = true; } void MainAppThread::run() diff --git a/mainapp.h b/mainapp.h index d24e637..2a00475 100644 --- a/mainapp.h +++ b/mainapp.h @@ -46,6 +46,10 @@ License along with FlashMQ. If not, see . class MainApp { +#ifdef TESTING + friend class MainAppThread; +#endif + static MainApp *instance; int num_threads = 0; -- libgit2 0.21.4