Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:17:42

0001 
0002 // Copyright 2020, Jefferson Science Associates, LLC.
0003 // Subject to the terms in the LICENSE file found in the top-level directory.
0004 
0005 #include "UserExceptionTests.h"
0006 #include "catch.hpp"
0007 
0008 #include <JANA/JApplication.h>
0009 
0010 TEST_CASE("UserExceptionTests") {
0011 
0012     JApplication app;
0013     app.SetParameterValue("jana:loglevel","debug");
0014     app.SetParameterValue("jana:extended_report", 0);
0015 
0016     SECTION("JEventSource::Open() excepts") {
0017 
0018         app.Add(new FlakySource(true, false));
0019         app.Add(new FlakyProcessor(false, false, false));
0020         REQUIRE_THROWS(app.Run(true));
0021     }
0022 
0023     SECTION("JEventSource::GetEvent() excepts") {
0024 
0025         app.Add(new FlakySource(false, true));
0026         app.Add(new FlakyProcessor(false, false, false));
0027         REQUIRE_THROWS(app.Run(true));
0028     }
0029 
0030     SECTION("JEventProcessor::Init() excepts") {
0031 
0032         app.Add(new FlakySource(false, false));
0033         app.Add(new FlakyProcessor(true, false, false));
0034         REQUIRE_THROWS(app.Run(true));
0035     }
0036 
0037     SECTION("JEventProcessor::Process() excepts") {
0038 
0039         app.Add(new FlakySource(false, false));
0040         app.Add(new FlakyProcessor(false, true, false));
0041         REQUIRE_THROWS(app.Run(true));
0042     }
0043 
0044     SECTION("JEventProcessor::Finish() excepts") {
0045 
0046         app.Add(new FlakySource(false, false));
0047         app.Add(new FlakyProcessor(false, false, true));
0048         REQUIRE_THROWS(app.Run(true));
0049     }
0050 }
0051