~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to tests/cpp_unit/Globals/GlobalsTest.cc

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "gtest/gtest.h"
21
21
 
22
 
#include "src/legacy/Interface/Squeal.hh"
 
22
#include "Utils/Exception.hh"
23
23
#include "src/legacy/Interface/MICERun.hh"
24
24
#include "src/legacy/Interface/dataCards.hh"
25
25
 
76
76
    // Check that we get an exception if initialising with bad data and that
77
77
    // _process is still NULL
78
78
    EXPECT_THROW
79
 
          (GlobalsManager::InitialiseGlobals("not json"), Squeal);
80
 
    EXPECT_THROW(Globals::GetInstance(), Squeal);
 
79
          (GlobalsManager::InitialiseGlobals("not json"), MAUS::Exception);
 
80
    EXPECT_THROW(Globals::GetInstance(), MAUS::Exception);
81
81
 
82
82
    // Check that we don't get an exception if initialising with good data and
83
83
    // that _process is not NULL. We will check the member data initialisation
89
89
    // Try deleting
90
90
    GlobalsManager::DeleteGlobals();
91
91
    // Check that we now get an exception on delete (already deleted)
92
 
    EXPECT_THROW(GlobalsManager::DeleteGlobals(), Squeal);
 
92
    EXPECT_THROW(GlobalsManager::DeleteGlobals(), MAUS::Exception);
93
93
 
94
94
    // Check that we now get an exception (the pointer allocated to NULL)
95
 
    EXPECT_THROW(Globals::GetInstance(), Squeal);
 
95
    EXPECT_THROW(Globals::GetInstance(), MAUS::Exception);
96
96
 
97
97
    // Check that we can reinitialise okay
98
98
    GlobalsManager::InitialiseGlobals(str);