Parcourir la source

ENH: Fix ctkErrorLogQtMessageHandlerWithThreadsTest1 with Qt5

Fix ctkErrorLogQtMessageHandlerWithThreadsTest1 with Qt5.

The message handler that ctkErrorLogQtMessageHandler installs to capture error
messages--ctkErrorLogModelQtMessageOutput--discards messages if it detects a
recursion depth greater than 10. However, the recursion count doesn't
differentiate between actual recursion and concurrent execution of the handler
in different threads. ctkErrorLogQtMessageHandlerWithThreadsTest1 starts 15
threads and fails because the recursion check discards error messages.

To work around the problem for now, reduce the number of threads in the test.
Max Smolens il y a 7 ans
Parent
commit
618ef68b50

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkErrorLogQtMessageHandlerWithThreadsTest1.cpp

@@ -74,7 +74,7 @@ int ctkErrorLogQtMessageHandlerWithThreadsTest1(int argc, char * argv [])
     model.registerMsgHandler(new ctkErrorLogQtMessageHandler);
     model.setMsgHandlerEnabled(ctkErrorLogQtMessageHandler::HandlerName, true);
 
-    int threadCount = 15;
+    int threadCount = 10;
     int maxIteration = 5;
     int messagesPerIteration = 3;
     startLogMessageThreads<LogQtMessageThread>(threadCount, maxIteration);