Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
berryTestCase.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "berryTestCase.h"
14 
15 #include <berryConfig.h>
16 #include <berryLog.h>
17 
18 #ifdef BLUEBERRY_DEBUG_SMARTPOINTER
19 #include <berryDebugUtil.h>
20 #endif
21 
22 #include <QString>
23 
24 #include <cassert>
25 
26 berry::TestCase::TestCase(const QString& testName) :
27  CppUnit::TestCase(testName.toStdString()), m_LeakDetails(false),
28  m_IgnoreLeakage(false)
29 {
30 
31 }
32 
34 {
35  m_LeakDetails = true;
36 }
37 
39 {
40  BERRY_WARN << "Ignoring Leaking Objects!!";
41  m_IgnoreLeakage = true;
42 }
43 
45 {
46 
47 }
48 
50 {
51 
52 }
53 
55 {
56  CppUnit::TestCase::setUp();
57 #ifdef BLUEBERRY_DEBUG_SMARTPOINTER
59 #endif
60  DoSetUp();
61 }
62 
64 {
65  CppUnit::TestCase::tearDown();
66  DoTearDown();
67 #ifdef BLUEBERRY_DEBUG_SMARTPOINTER
68  assert(m_IgnoreLeakage || !DebugUtil::PrintObjectSummary(m_LeakDetails));
69 #endif
70 
71  m_LeakDetails = false;
72 }
73 
void IgnoreLeakingObjects()
static void ResetObjectSummary()
#define BERRY_WARN
Definition: berryLog.h:21
TestCase(const QString &testName)
static bool PrintObjectSummary(bool details=false)
virtual void DoTearDown()
virtual void DoSetUp()