135 for (
int steering: {steering1, steering2}) {
136 Flow flow(steering, {
"flow2.root"});
138 BOOST_TEST_MESSAGE(
"Trying to get a branch before the input has been set up" );
139 BOOST_REQUIRE_THROW( flow.GetBranchReadWrite<
DP::RecEvent>(
"recEvent"), wrapexcept<invalid_argument> );
140 auto tIn = flow.GetInputTree(
Slice{1, 0});
143 BOOST_TEST_MESSAGE(
"Trying to get a branch before the output has been set up" );
144 BOOST_REQUIRE_THROW( flow.GetBranchReadWrite<
DP::RecEvent>(
"recEvent"), wrapexcept<invalid_argument> );
146 BOOST_TEST_MESSAGE(
"Testing default name in case of friends" );
147 tIn->GetTree()->SetTitle(
"");
148 auto t1 = flow.GetOutputTree();
150 BOOST_TEST_MESSAGE(
"Trying to write to an existing branch assuming a wrong plain type" );
151 BOOST_REQUIRE_THROW( flow.GetBranchReadOnly<
string>(
"myInt"), wrapexcept<DE::BadInput> );
153 BOOST_TEST_MESSAGE(
"Trying to read an existing branch with correct plain type" );
154 BOOST_REQUIRE_NO_THROW( flow.GetBranchReadWrite<
int>(
"myInt") );
156 BOOST_TEST_MESSAGE(
"Trying to read an existing branch with correct custom type" );
157 BOOST_REQUIRE_NO_THROW( flow.GetBranchReadWrite<
DP::RecEvent>(
"recEvent") );
159 BOOST_TEST_MESSAGE(
"Trying to read an inexisting branch" );
160 BOOST_REQUIRE_THROW( flow.GetBranchReadWrite<
DP::RecEvent>(
"recEvent2"), wrapexcept<DE::BadInput> );
163 BOOST_TEST_MESSAGE(
"Trying to write to an existing branch assuming a wrong plain type, after it has been read" );
164 BOOST_REQUIRE_THROW( flow.GetBranchReadWrite<
string>(
"myInt"), wrapexcept<bad_any_cast> );
166 BOOST_TEST_MESSAGE(
"Trying to write to an existing branch assuming a wrong custom type" );
167 BOOST_REQUIRE_THROW( flow.GetBranchReadWrite<
DP::GenEvent>(
"recEvent"), wrapexcept<bad_any_cast> );
169 BOOST_TEST_MESSAGE(
"Trying to write to a branch with a missing dictionary." );
170 BOOST_REQUIRE_THROW( flow.GetBranchReadWrite<
EventBoom>(
"recEventBOOM"), wrapexcept<DE::BadInput> );
172 BOOST_TEST_MESSAGE(
"Trying to write twice to the same branch." );
175 BOOST_REQUIRE_NO_THROW( ev = flow.GetBranchReadWrite<
DP::RecEvent>(
"recEvent") );
176 BOOST_REQUIRE_NO_THROW( ev2 = flow.GetBranchReadWrite<
DP::RecEvent>(
"recEvent") );