Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkVerboseLimitedLinearUndoTest.cpp File Reference
#include "mitkInteractionConst.h"
#include "mitkOperation.h"
#include "mitkUndoController.h"
#include "mitkVerboseLimitedLinearUndo.h"
#include "mitkTestingMacros.h"
#include <iostream>

Go to the source code of this file.


 DataCollection - Class to facilitate loading/accessing structured data.


int mitkVerboseLimitedLinearUndoTest (int, char *[])
 Test of the LimitedLinearUndo object. More...


int g_GlobalCounter

Function Documentation

int mitkVerboseLimitedLinearUndoTest ( int  ,
char *  [] 

Test of the LimitedLinearUndo object.

This test was motivated by bug 3248 which had to check memory leakage while using mitkOperations within the UndoMechanism. OperationObjects are added to the UndoController and stored within two lists (m_UndoList and m_RedoList) inside LimitedLinearUndo and derived from this VerboseLimitedLinearUndo. When using Undo during runtime operations are moved from UndoList to RedoList. In case of a new interaction, causing new operations to be stored in the UndoList the RedoList needs to be cleared. For this, the operations and all connected objects need to be deleted and memory to be freed. And this what this test checks!

argc and argv are the command line parameters which were passed to the ADD_TEST command in the CMakeLists.txt file. For the automatic tests, argv is either empty for the simple tests or contains the filename of a test image for the image tests (see CMakeLists.txt).

Definition at line 60 of file mitkVerboseLimitedLinearUndoTest.cpp.

References g_GlobalCounter, mitk::UndoStackItem::IncCurrObjectEventId(), MITK_TEST_BEGIN(), MITK_TEST_CONDITION_REQUIRED, MITK_TEST_END(), mitk::OpTEST, and mitk::UndoController::VERBOSE_LIMITEDLINEARUNDO.

Variable Documentation

int g_GlobalCounter