18 #define BOOST_TEST_MODULE ( PointIsolationAlg_test ) 19 #include "boost/test/unit_test.hpp" 29 #include "TInterpreter.h" 30 #include "TClassEdit.h" 40 TInterpreter* interpreter = gROOT->GetInterpreter();
44 char* classNameC = TClassEdit::DemangleTypeIdName(
typeid(
T), err);
48 TClassEdit::GetNormalizedName(normalizedClassName, classNameC);
51 std::free(classNameC);
54 return interpreter->GenerateTClass(normalizedClassName.c_str(), kTRUE, kTRUE);
71 QuickGenerateTClass<MyAssns_t>();
76 std::array<std::pair<Index_t, std::vector<Index_t>>, 3U>
expected;
77 expected[0] = { 0, { 0, 3, 6 } };
78 expected[1] = { 1, { 2, 4, 6 } };
79 expected[2] = { 3, { 8, 10, 12, 13 } };
84 for (
auto const& pair: expected) {
85 auto const& aIndex = pair.first;
86 for (
auto const& bIndex: pair.second) {
87 assns.addSingle({ aPID, aIndex,
nullptr }, { bPID, bIndex,
nullptr });
91 std::vector<std::vector<Index_t>> results;
93 std::cout <<
"Association group #" << results.size() <<
":" <<
std::endl;
94 results.emplace_back();
95 std::vector<Index_t>& myBs = results.back();
98 myBs.push_back(
B.key());
103 std::cout <<
"Starting check..." <<
std::endl;
104 BOOST_TEST(results.size() == expected.size());
105 for (
size_t i = 0; i < results.size(); ++i) {
106 auto const& Bs = results[i];
107 auto const& expectedBs = expected[i].second;
108 BOOST_TEST_MESSAGE(
" element #" << i <<
", A=" << expected[i].first);
109 BOOST_TEST(Bs.size() == expectedBs.size());
110 for (
size_t j = 0; j < expectedBs.size(); ++j) {
111 BOOST_TEST_MESSAGE(
" assn #" << j);
112 BOOST_TEST(Bs[j] == expectedBs[j]);
BOOST_AUTO_TEST_CASE(AssociatedGroupsTestCase)
unsigned int Index_t
Type to denote the index of the flag.
auto associated_groups(A const &assns)
Helper functions to access associations in order.
void AssociatedGroupsTest()
void err(const char *fmt,...)
Helper functions to access associations in order.
QTextStream & endl(QTextStream &s)
TClass * QuickGenerateTClass()