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; },
66 std::vector<void*> inputs;
71 void* header = malloc(
stack.size());
72 void* payload = malloc(
sizeof(
int));
74 memcpy(payload, &
value,
sizeof(
int));
75 inputs.emplace_back(header);
76 inputs.emplace_back(payload);
79 auto createEmpty = [&inputs]() {
80 inputs.emplace_back(
nullptr);
81 inputs.emplace_back(
nullptr);
94 createMessage(dh1, 1);
95 createMessage(dh2, 2);
98 [](size_t) ->
size_t {
return 1; },
100 [&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])}; },
106 REQUIRE_NOTHROW(record.get(
"x"));
107 REQUIRE_NOTHROW(record.get(
"y"));
108 REQUIRE_NOTHROW(record.get(
"z"));
109 auto ref00 = record.get(
"x");
110 auto ref10 = record.get(
"y");
114 REQUIRE_NOTHROW(record.get(
"x"));
115 auto ref01 = record.getByPos(0);
116 auto ref11 = record.getByPos(1);
120 REQUIRE(ref00.header == ref01.header);
121 REQUIRE(ref00.payload == ref01.payload);
122 REQUIRE(ref10.header == ref11.header);
123 REQUIRE(ref10.payload == ref11.payload);
125 REQUIRE(record.isValid(
"x") ==
true);
126 REQUIRE(record.isValid(
"y") ==
true);
127 REQUIRE(record.isValid(
"z") ==
false);
128 REQUIRE(record.size() == 3);
129 REQUIRE(record.countValidInputs() == 2);
131 REQUIRE(record.isValid(0) ==
true);
132 REQUIRE(record.isValid(1) ==
true);
133 REQUIRE(record.isValid(2) ==
false);
138 REQUIRE(record.get<
int>(
"x") == 1);
139 REQUIRE(record.get<
int>(
"y") == 2);
141 REQUIRE(record.get<
int>(
"x") == 1);
142 REQUIRE(record.get<
int>(
"x") == 1);
146 for (
auto input = record.begin(),
end = record.end(); input !=
end; input++, position++) {
148 REQUIRE(input.matches(
"TPC") ==
true);
149 REQUIRE(input.matches(
"TPC",
"CLUSTERS") ==
true);
150 REQUIRE(input.matches(
"ITS",
"CLUSTERS") ==
false);
153 REQUIRE(input.matches(
"ITS") ==
true);
154 REQUIRE(input.matches(
"ITS",
"CLUSTERS") ==
true);
155 REQUIRE(input.matches(
"TPC",
"CLUSTERS") ==
false);
158 REQUIRE(position != 2);
163 REQUIRE(record.begin().size() == 1);
165 REQUIRE(record.end().size() == 0);
167 REQUIRE(record.end().begin() == record.end().end());