![]() |
Project
|
A unit test of mergers. More...
#include <gsl/span>#include <memory>#include <stdexcept>#include <boost/test/unit_test.hpp>#include "Mergers/MergerAlgorithm.h"#include "Mergers/CustomMergeableTObject.h"#include "Mergers/CustomMergeableObject.h"#include "Mergers/ObjectStore.h"#include <TObjArray.h>#include <TObjString.h>#include <TH1.h>#include <TH2.h>#include <TH3.h>#include <THn.h>#include <TTree.h>#include <THnSparse.h>#include <TF1.h>#include <TGraph.h>#include <TProfile.h>#include <TCanvas.h>Go to the source code of this file.
Macros | |
| #define | BOOST_TEST_MODULE Test Utilities MergerAlgorithm |
| #define | BOOST_TEST_MAIN |
| #define | BOOST_TEST_DYN_LINK |
Functions | |
| BOOST_AUTO_TEST_CASE (MergerEmptyObjects) | |
| BOOST_AUTO_TEST_CASE (MergerNotSupportedTObject) | |
| BOOST_AUTO_TEST_CASE (MergerTheSameObject) | |
| BOOST_AUTO_TEST_CASE (MergerSingularObjects) | |
| BOOST_AUTO_TEST_CASE (MergerCollection) | |
| TCanvas * | createCanvas (std::string name, std::string title, std::vector< std::shared_ptr< TH1I > > &histograms) |
| auto | collectUnderlyingObjects (TCanvas *canvas) -> std::vector< TObject * > |
| BOOST_AUTO_TEST_CASE (MergerTCanvas) | |
| BOOST_AUTO_TEST_CASE (Deleting) | |
| BOOST_AUTO_TEST_CASE (AverageHisto) | |
| gsl::span< float > | to_span (std::shared_ptr< TH1F > &histo) |
| template<typename T , std::size_t N> | |
| gsl::span< T, N > | to_array (T(&&arr)[N]) |
| target1_1 | Fill (5) |
| BOOST_TEST (target.size()==2) | |
| BOOST_TEST (other.size()==2) | |
| BOOST_TEST (to_span(target1_1)==to_array({0., 0., 0., 0., 0., 0., 2., 0., 0., 0., 0., 0.}), boost::test_tools::per_element()) | |
| BOOST_TEST (to_span(target1_2)==to_array({0., 0., 0., 0., 0., 0., 4., 0., 0., 0., 0., 0.}), boost::test_tools::per_element()) | |
| BOOST_TEST (to_span(other1_1)==to_array({0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.}), boost::test_tools::per_element()) | |
| BOOST_TEST (to_span(other1_2)==to_array({0., 0., 0., 0., 0., 0., 2., 0., 0., 0., 0., 0.}), boost::test_tools::per_element()) | |
| BOOST_CHECK_NO_THROW (algorithm::merge(target, other)) | |
| BOOST_TEST (std::string_view{target[0]->GetName()}=="histo 1-1") | |
| BOOST_TEST (std::string_view{target[1]->GetName()}=="histo 1-2") | |
Variables | |
| constexpr size_t | bins = 10 |
| constexpr size_t | min = 0 |
| constexpr size_t | max = 10 |
| auto | target1_2 = std::make_shared<TH1F>("histo 1-2", "histo 1-2", bins, min, max) |
| VectorOfTObjectPtrs | target {target1_1, target1_2} |
| auto | other1_1 = std::make_shared<TH1F>("histo 1-1", "histo 1-1", bins, min, max) |
| auto | other1_2 = std::make_shared<TH1F>("histo 1-2", "histo 1-2", bins, min, max) |
| VectorOfTObjectPtrs | other {other1_1, other1_2} |
A unit test of mergers.
Definition in file test_Algorithm.cxx.
| #define BOOST_TEST_DYN_LINK |
Definition at line 22 of file test_Algorithm.cxx.
| #define BOOST_TEST_MAIN |
Definition at line 21 of file test_Algorithm.cxx.
| #define BOOST_TEST_MODULE Test Utilities MergerAlgorithm |
Definition at line 20 of file test_Algorithm.cxx.
| BOOST_AUTO_TEST_CASE | ( | AverageHisto | ) |
Definition at line 450 of file test_Algorithm.cxx.
| BOOST_AUTO_TEST_CASE | ( | Deleting | ) |
Definition at line 420 of file test_Algorithm.cxx.
| BOOST_AUTO_TEST_CASE | ( | MergerCollection | ) |
Definition at line 255 of file test_Algorithm.cxx.
| BOOST_AUTO_TEST_CASE | ( | MergerEmptyObjects | ) |
Definition at line 51 of file test_Algorithm.cxx.
| BOOST_AUTO_TEST_CASE | ( | MergerNotSupportedTObject | ) |
Definition at line 67 of file test_Algorithm.cxx.
| BOOST_AUTO_TEST_CASE | ( | MergerSingularObjects | ) |
Definition at line 84 of file test_Algorithm.cxx.
| BOOST_AUTO_TEST_CASE | ( | MergerTCanvas | ) |
Definition at line 344 of file test_Algorithm.cxx.
| BOOST_AUTO_TEST_CASE | ( | MergerTheSameObject | ) |
Definition at line 77 of file test_Algorithm.cxx.
| BOOST_CHECK_NO_THROW | ( | algorithm::merge(target, other) | ) |
| BOOST_TEST | ( | other. | size() = =2 | ) |
| BOOST_TEST | ( | std::string_view{target[0]->GetName()} | = ="histo 1-1" | ) |
| BOOST_TEST | ( | std::string_view{target[1]->GetName()} | = ="histo 1-2" | ) |
| BOOST_TEST | ( | target. | size() = =2 | ) |
| BOOST_TEST | ( | to_span(other1_1) | = =to_array({0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.}), |
| boost::test_tools::per_element() | |||
| ) |
| BOOST_TEST | ( | to_span(other1_2) | = =to_array({0., 0., 0., 0., 0., 0., 2., 0., 0., 0., 0., 0.}), |
| boost::test_tools::per_element() | |||
| ) |
| BOOST_TEST | ( | to_span(target1_1) | = =to_array({0., 0., 0., 0., 0., 0., 2., 0., 0., 0., 0., 0.}), |
| boost::test_tools::per_element() | |||
| ) |
| BOOST_TEST | ( | to_span(target1_2) | = =to_array({0., 0., 0., 0., 0., 0., 4., 0., 0., 0., 0., 0.}), |
| boost::test_tools::per_element() | |||
| ) |
| auto collectUnderlyingObjects | ( | TCanvas * | canvas | ) | -> std::vector<TObject*> |
Definition at line 321 of file test_Algorithm.cxx.
| TCanvas * createCanvas | ( | std::string | name, |
| std::string | title, | ||
| std::vector< std::shared_ptr< TH1I > > & | histograms | ||
| ) |
Definition at line 309 of file test_Algorithm.cxx.
| other1_2 Fill | ( | 5 | ) |
| gsl::span< T, N > to_array | ( | T(&&) | arr[N] | ) |
Definition at line 475 of file test_Algorithm.cxx.
| gsl::span< float > to_span | ( | std::shared_ptr< TH1F > & | histo | ) |
Definition at line 469 of file test_Algorithm.cxx.
|
constexpr |
Definition at line 47 of file test_Algorithm.cxx.
|
constexpr |
Definition at line 49 of file test_Algorithm.cxx.
|
constexpr |
Definition at line 48 of file test_Algorithm.cxx.
| VectorOfTObjectPtrs other {other1_1, other1_2} |
Definition at line 501 of file test_Algorithm.cxx.
Definition at line 494 of file test_Algorithm.cxx.
Definition at line 497 of file test_Algorithm.cxx.
| VectorOfTObjectPtrs target {target1_1, target1_2} |
Definition at line 492 of file test_Algorithm.cxx.
Definition at line 486 of file test_Algorithm.cxx.