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) ->
size_t {
return 0; },
67 std::vector<void*> inputs;
72 void* header = malloc(
stack.size());
73 void* payload = malloc(
sizeof(
int));
75 memcpy(payload, &
value,
sizeof(
int));
76 inputs.emplace_back(header);
77 inputs.emplace_back(payload);
80 auto createEmpty = [&inputs]() {
81 inputs.emplace_back(
nullptr);
82 inputs.emplace_back(
nullptr);
95 createMessage(dh1, 1);
96 createMessage(dh2, 2);
99 [](size_t) ->
size_t {
return 1; },
101 [&inputs](
size_t i,
DataRefIndices idx) {
return DataRef{
nullptr,
static_cast<char const*
>(inputs[2 *
i + idx.headerIdx]),
static_cast<char const*
>(inputs[2 *
i + idx.payloadIdx])}; },
108 REQUIRE_NOTHROW(record.get(
"x"));
109 REQUIRE_NOTHROW(record.get(
"y"));
110 REQUIRE_NOTHROW(record.get(
"z"));
111 auto ref00 = record.get(
"x");
112 auto ref10 = record.get(
"y");
116 REQUIRE_NOTHROW(record.get(
"x"));
117 auto ref01 = record.getByPos(0);
118 auto ref11 = record.getByPos(1);
122 REQUIRE(ref00.header == ref01.header);
123 REQUIRE(ref00.payload == ref01.payload);
124 REQUIRE(ref10.header == ref11.header);
125 REQUIRE(ref10.payload == ref11.payload);
127 REQUIRE(record.isValid(
"x") ==
true);
128 REQUIRE(record.isValid(
"y") ==
true);
129 REQUIRE(record.isValid(
"z") ==
false);
130 REQUIRE(record.size() == 3);
131 REQUIRE(record.countValidInputs() == 2);
133 REQUIRE(record.isValid(0) ==
true);
134 REQUIRE(record.isValid(1) ==
true);
135 REQUIRE(record.isValid(2) ==
false);
140 REQUIRE(record.get<
int>(
"x") == 1);
141 REQUIRE(record.get<
int>(
"y") == 2);
143 REQUIRE(record.get<
int>(
"x") == 1);
144 REQUIRE(record.get<
int>(
"x") == 1);
148 for (
auto input = record.begin(),
end = record.end(); input !=
end; input++, position++) {
150 REQUIRE(input.matches(
"TPC") ==
true);
151 REQUIRE(input.matches(
"TPC",
"CLUSTERS") ==
true);
152 REQUIRE(input.matches(
"ITS",
"CLUSTERS") ==
false);
155 REQUIRE(input.matches(
"ITS") ==
true);
156 REQUIRE(input.matches(
"ITS",
"CLUSTERS") ==
true);
157 REQUIRE(input.matches(
"TPC",
"CLUSTERS") ==
false);
160 REQUIRE(position != 2);
165 REQUIRE(record.begin().parts().size() == 1);
167 REQUIRE(record.end().parts().size() == 0);
169 REQUIRE(record.end().parts().begin() == record.end().parts().end());