#include <boost/test/included/unit_test.hpp>
#include <boost/exception/all.hpp>
#include <TTree.h>
#include "Looper.h"
◆ BOOST_TEST_MODULE
#define BOOST_TEST_MODULE testLooper |
◆ DOXYGEN_SHOULD_SKIP_THIS
#define DOXYGEN_SHOULD_SKIP_THIS |
◆ BOOST_AUTO_TEST_CASE() [1/2]
BOOST_AUTO_TEST_CASE |
( |
shared |
| ) |
|
17 auto t = make_shared<TTree>(
"events",
"events");
20 BOOST_REQUIRE_THROW(
Looper looper(t), boost::wrapexcept<invalid_argument> );
23 for (
Looper looper(100ll, {2,0}); looper(); ++looper) t->Fill();
24 for (
Looper looper(100ll, {2,1}); looper(); ++looper) t->Fill();
26 BOOST_REQUIRE( t->GetEntries() == 100 );
27 BOOST_REQUIRE_NO_THROW(
Looper looper(t) );
29 #pragma GCC diagnostic push
30 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
32 BOOST_REQUIRE_NO_THROW(
Looper(t, {10,5}) );
35 BOOST_REQUIRE_THROW(
Looper(t, {0,0}), boost::wrapexcept<invalid_argument> );
38 BOOST_REQUIRE_THROW(
Looper(t, {5,10}), boost::wrapexcept<invalid_argument> );
41 BOOST_REQUIRE_THROW(
Looper(t, {1000,0}), boost::wrapexcept<invalid_argument> );
52 for (
Looper looper(t, {10,5}); looper(); ++looper) {
57 #pragma GCC diagnostic pop
◆ BOOST_AUTO_TEST_CASE() [2/2]
BOOST_AUTO_TEST_CASE |
( |
unique |
| ) |
|
63 auto t = make_unique<TTree>(
"events",
"events");
64 BOOST_REQUIRE_THROW(
Looper looper(t), boost::wrapexcept<invalid_argument> );