~mwinter4/maus/ckov-reco

« back to all changes in this revision

Viewing changes to tests/cpp_unit/Simulation/MAUSEventActionTest.cc

  • Committer: Durga Rajaram
  • Date: 2014-01-14 07:07:02 UTC
  • mfrom: (659.1.80 relcand)
  • Revision ID: durga@fnal.gov-20140114070702-2l1fuj1w6rraw7xe
Tags: MAUS-v0.7.6
MAUS-v0.7.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "src/common_cpp/Simulation/MAUSGeant4Manager.hh"
21
21
#include "src/common_cpp/Simulation/MAUSEventAction.hh"
22
 
#include "src/legacy/Interface/Squeal.hh"
 
22
#include "Utils/Exception.hh"
23
23
 
24
24
using MAUS::MAUSEventAction;
25
25
using MAUS::MAUSGeant4Manager;
27
27
TEST(MAUSEventActionTest, SetGetEventsTest) {
28
28
    MAUSEventAction* _eventAct
29
29
                           = MAUSGeant4Manager::GetInstance()->GetEventAction();
30
 
    EXPECT_THROW(_eventAct->SetEvents(Json::Value(Json::objectValue)), Squeal);
 
30
    EXPECT_THROW(_eventAct->SetEvents(Json::Value(Json::objectValue)), MAUS::Exception);
31
31
    Json::Value event_array = Json::Value(Json::arrayValue);
32
32
    event_array.append(Json::Value(Json::objectValue));
33
33
    event_array.append(Json::Value(Json::arrayValue));
34
 
    EXPECT_THROW(_eventAct->SetEvents(event_array), Squeal);
 
34
    EXPECT_THROW(_eventAct->SetEvents(event_array), MAUS::Exception);
35
35
    event_array[1] = Json::Value(Json::objectValue);
36
36
    EXPECT_NO_THROW(_eventAct->SetEvents(event_array));
37
37
    EXPECT_EQ(event_array, _eventAct->GetEvents());
58
58
    // _events out of range
59
59
    Json::Value events = Json::Value(Json::arrayValue);
60
60
    _g4->GetEventAction()->SetEvents(events);
61
 
    EXPECT_THROW(_g4->GetEventAction()->EndOfEventAction(NULL), Squeal);
 
61
    EXPECT_THROW(_g4->GetEventAction()->EndOfEventAction(NULL), MAUS::Exception);
62
62
 
63
63
    Json::Value::UInt zero(0);
64
64
    events.append(Json::Value(Json::objectValue));
81
81
 
82
82
    EXPECT_EQ(_g4->GetEventAction()->GetEvents(), events);
83
83
    // _events out of range
84
 
    EXPECT_THROW(_g4->GetEventAction()->EndOfEventAction(NULL), Squeal);
 
84
    EXPECT_THROW(_g4->GetEventAction()->EndOfEventAction(NULL), MAUS::Exception);
85
85
 
86
86
    // reset _primary index
87
87
    _g4->GetEventAction()->SetEvents(events);