Page MenuHomePhabricator

Disable Operating System Debug/Error Popups while running faulty tests on Windows
Closed, ResolvedPublic


If the Visual C runtime encounters an failed assertion, it popups an error box allowing to debug or abort the process. This leads to problems while running automated units tests.

Following code needs to be run/added to test initialization routines (maybe there where the mitk logging backend is enabled in tests):

void DisableWindowsAndVisualCErrorReporting( )
#ifdef WIN32

#ifdef _DEBUG
  _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );


This code works for a while now in MES, which it needs for its sub-process management.

Event Timeline

Following includes are required to compile the statements in the previous comment:

#ifdef WIN32

#include <windows.h>
#if defined _DEBUG
  #include <crtdbg.h>


kislinsk claimed this task.