Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
berryTestCase.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "berryTestCase.h"
18 
19 #include <berryConfig.h>
20 #include <berryLog.h>
21 
22 #ifdef BLUEBERRY_DEBUG_SMARTPOINTER
23 #include <berryDebugUtil.h>
24 #endif
25 
26 #include <QString>
27 
28 #include <cassert>
29 
30 berry::TestCase::TestCase(const QString& testName) :
31  CppUnit::TestCase(testName.toStdString()), m_LeakDetails(false),
32  m_IgnoreLeakage(false)
33 {
34 
35 }
36 
38 {
39  m_LeakDetails = true;
40 }
41 
43 {
44  BERRY_WARN << "Ignoring Leaking Objects!!";
45  m_IgnoreLeakage = true;
46 }
47 
49 {
50 
51 }
52 
54 {
55 
56 }
57 
59 {
60  CppUnit::TestCase::setUp();
61 #ifdef BLUEBERRY_DEBUG_SMARTPOINTER
63 #endif
64  DoSetUp();
65 }
66 
68 {
69  CppUnit::TestCase::tearDown();
70  DoTearDown();
71 #ifdef BLUEBERRY_DEBUG_SMARTPOINTER
72  assert(m_IgnoreLeakage || !DebugUtil::PrintObjectSummary(m_LeakDetails));
73 #endif
74 
75  m_LeakDetails = false;
76 }
77 
void IgnoreLeakingObjects()
static void ResetObjectSummary()
#define BERRY_WARN
Definition: berryLog.h:25
TestCase(const QString &testName)
static bool PrintObjectSummary(bool details=false)
virtual void DoTearDown()
virtual void DoSetUp()