ソースを参照

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 8 年 前
コミット
618ef68b50
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  1. 1 1
      Libs/Widgets/Testing/Cpp/ctkErrorLogQtMessageHandlerWithThreadsTest1.cpp

+ 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);