28 InputSpec spec1{
"x",
"TPC",
"CLUSTERS", 0, Lifetime::Timeframe};
29 InputSpec spec2{
"y",
"ITS",
"CLUSTERS", 0, Lifetime::Timeframe};
30 InputSpec spec3{
"z",
"TST",
"EMPTY", 0, Lifetime::Timeframe};
43 std::vector<InputRoute> schema = {
44 createRoute(
"x_source", spec1),
45 createRoute(
"y_source", spec2),
46 createRoute(
"z_source", spec3)};
50 [](size_t) {
return DataRef{
nullptr,
nullptr,
nullptr}; },
63 std::vector<void*> inputs;
68 void* header = malloc(
stack.size());
69 void* payload = malloc(
sizeof(
int));
71 memcpy(payload, &
value,
sizeof(
int));
72 inputs.emplace_back(header);
73 inputs.emplace_back(payload);
76 auto createEmpty = [&inputs]() {
77 inputs.emplace_back(
nullptr);
78 inputs.emplace_back(
nullptr);
91 createMessage(dh1, 1);
92 createMessage(dh2, 2);
94 InputSpan span2{[&inputs](
size_t i) {
return DataRef{
nullptr,
static_cast<char const*
>(inputs[2 *
i]),
static_cast<char const*
>(inputs[2 *
i + 1])}; }, inputs.size() / 2};
98 REQUIRE_NOTHROW(record.get(
"x"));
99 REQUIRE_NOTHROW(record.get(
"y"));
100 REQUIRE_NOTHROW(record.get(
"z"));
101 auto ref00 = record.get(
"x");
102 auto ref10 = record.get(
"y");
106 REQUIRE_NOTHROW(record.get(
"x"));
107 auto ref01 = record.getByPos(0);
108 auto ref11 = record.getByPos(1);
112 REQUIRE(ref00.header == ref01.header);
113 REQUIRE(ref00.payload == ref01.payload);
114 REQUIRE(ref10.header == ref11.header);
115 REQUIRE(ref10.payload == ref11.payload);
117 REQUIRE(record.isValid(
"x") ==
true);
118 REQUIRE(record.isValid(
"y") ==
true);
119 REQUIRE(record.isValid(
"z") ==
false);
120 REQUIRE(record.size() == 3);
121 REQUIRE(record.countValidInputs() == 2);
123 REQUIRE(record.isValid(0) ==
true);
124 REQUIRE(record.isValid(1) ==
true);
125 REQUIRE(record.isValid(2) ==
false);
130 REQUIRE(record.get<
int>(
"x") == 1);
131 REQUIRE(record.get<
int>(
"y") == 2);
133 REQUIRE(record.get<
int>(
"x") == 1);
134 REQUIRE(record.get<
int>(
"x") == 1);
138 for (
auto input = record.begin(),
end = record.end(); input !=
end; input++, position++) {
140 REQUIRE(input.matches(
"TPC") ==
true);
141 REQUIRE(input.matches(
"TPC",
"CLUSTERS") ==
true);
142 REQUIRE(input.matches(
"ITS",
"CLUSTERS") ==
false);
145 REQUIRE(input.matches(
"ITS") ==
true);
146 REQUIRE(input.matches(
"ITS",
"CLUSTERS") ==
true);
147 REQUIRE(input.matches(
"TPC",
"CLUSTERS") ==
false);
150 REQUIRE(position != 2);
155 REQUIRE(record.begin().size() == 1);
157 REQUIRE(record.end().size() == 0);
159 REQUIRE(record.end().begin() == record.end().end());