소스 검색

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 7 년 전
부모
커밋
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);