Commit 00dd7943754b690221a6414694ee68df836858d9
1 parent
15945e62
Fix tests
Showing
3 changed files
with
7 additions
and
0 deletions
FlashMQTests/FlashMQTests.pro
| @@ -41,6 +41,7 @@ SOURCES += tst_maintests.cpp \ | @@ -41,6 +41,7 @@ SOURCES += tst_maintests.cpp \ | ||
| 41 | ../evpencodectxmanager.cpp \ | 41 | ../evpencodectxmanager.cpp \ |
| 42 | ../acltree.cpp \ | 42 | ../acltree.cpp \ |
| 43 | ../threadlocalutils.cpp \ | 43 | ../threadlocalutils.cpp \ |
| 44 | + ../flashmq_plugin.cpp \ | ||
| 44 | mainappthread.cpp \ | 45 | mainappthread.cpp \ |
| 45 | twoclienttestcontext.cpp | 46 | twoclienttestcontext.cpp |
| 46 | 47 | ||
| @@ -75,6 +76,7 @@ HEADERS += \ | @@ -75,6 +76,7 @@ HEADERS += \ | ||
| 75 | ../evpencodectxmanager.h \ | 76 | ../evpencodectxmanager.h \ |
| 76 | ../acltree.h \ | 77 | ../acltree.h \ |
| 77 | ../threadlocalutils.h \ | 78 | ../threadlocalutils.h \ |
| 79 | + ../flashmq_plugin.h \ | ||
| 78 | mainappthread.h \ | 80 | mainappthread.h \ |
| 79 | twoclienttestcontext.h | 81 | twoclienttestcontext.h |
| 80 | 82 |
FlashMQTests/mainappthread.cpp
| @@ -21,6 +21,7 @@ MainAppThread::MainAppThread(QObject *parent) : QThread(parent) | @@ -21,6 +21,7 @@ MainAppThread::MainAppThread(QObject *parent) : QThread(parent) | ||
| 21 | { | 21 | { |
| 22 | MainApp::initMainApp(1, nullptr); | 22 | MainApp::initMainApp(1, nullptr); |
| 23 | appInstance = MainApp::getMainApp(); | 23 | appInstance = MainApp::getMainApp(); |
| 24 | + appInstance->settings->allowAnonymous = true; | ||
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | void MainAppThread::run() | 27 | void MainAppThread::run() |
mainapp.h
| @@ -46,6 +46,10 @@ License along with FlashMQ. If not, see <https://www.gnu.org/licenses/>. | @@ -46,6 +46,10 @@ License along with FlashMQ. If not, see <https://www.gnu.org/licenses/>. | ||
| 46 | 46 | ||
| 47 | class MainApp | 47 | class MainApp |
| 48 | { | 48 | { |
| 49 | +#ifdef TESTING | ||
| 50 | + friend class MainAppThread; | ||
| 51 | +#endif | ||
| 52 | + | ||
| 49 | static MainApp *instance; | 53 | static MainApp *instance; |
| 50 | int num_threads = 0; | 54 | int num_threads = 0; |
| 51 | 55 |