Skip to content

Commit

Permalink
Fix tests after behavior of EventStore changed in AIDASoft#97
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 29, 2020
1 parent 02bcb56 commit 9e46042
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/read_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ void processEvent(podio::EventStore& store, bool verboser, unsigned eventNum) {
}



auto& failing = store.get<ExampleClusterCollection>("notthere");
if(failing.isValid() == true) {
throw std::runtime_error("Collection 'notthere' should not be valid");
};
try {
auto& failing = store.get<ExampleClusterCollection>("notthere");
} catch(const std::runtime_error& err) {
if (std::string(err.what()) != "No collection \'notthere\' is present in the EventStore") {
throw std::runtime_error("Trying to get non present collection \'notthere' should throw an exception");
}
}

auto& strings = store.get<ExampleWithStringCollection>("strings");
if(strings.isValid()){
Expand Down

0 comments on commit 9e46042

Please sign in to comment.