#include <Variation.h>
#include <TList.h>
#include <TObjString.h>
#include <boost/test/included/unit_test.hpp>
#include <boost/exception/all.hpp>
◆ BOOST_TEST_MODULE
◆ BOOST_AUTO_TEST_CASE()
BOOST_AUTO_TEST_CASE |
( |
variation |
| ) |
|
19 auto userinfo =
new TList;
20 userinfo->SetName(
"variations");
24 auto groupContents =
new TList;
25 groupContents->SetName(
"RecJetWeights");
26 groupContents->Add(
new TObjString(
"bSFUp" ));
27 groupContents->Add(
new TObjString(
"bSFDown"));
28 groupContents->Add(
new TObjString(
"lSFUp" ));
29 groupContents->Add(
new TObjString(
"lSFDown"));
31 userinfo->Add(groupContents);
33 BOOST_REQUIRE_NO_THROW( variations =
GetVariations(*userinfo) );
35 BOOST_TEST( variations.front().Group() ==
"" );
36 BOOST_TEST( variations.front().Name() ==
"nominal" );
37 for (
size_t i = 1; i < variations.size(); ++i) {
38 cout << i <<
' ' << variations[i] << endl;
39 BOOST_TEST( variations[i].Group() ==
"RecJetWeights" );
42 BOOST_TEST( variations[2].Name() ==
"bSFDown" );
44 BOOST_TEST( variations[4].Name() ==
"lSFDown" );
48 groupContents->Add(
new TObjString(
""));
49 BOOST_REQUIRE_THROW( variations =
GetVariations(*userinfo), boost::wrapexcept<invalid_argument> );