Skip to content

Commit 9877677

Browse files
committed
DPL: add test for ConcreteDataType serialization
1 parent de78a8f commit 9877677

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Framework/Core/test/test_WorkflowSerialization.cxx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,42 @@ BOOST_AUTO_TEST_CASE(TestVerifyWorkflow)
8383
// also check if the conversion to ConcreteDataMatcher is working at import
8484
BOOST_CHECK(std::get_if<ConcreteDataMatcher>(&w1[0].inputs[0].matcher) != nullptr);
8585
}
86+
87+
/// Test a workflow with a single data processor with a single input
88+
/// which has a wildcard on subspec.
89+
BOOST_AUTO_TEST_CASE(TestVerifyWildcard)
90+
{
91+
using namespace o2::framework;
92+
WorkflowSpec w0{
93+
DataProcessorSpec{
94+
.name = "A",
95+
.inputs = {{"clbPayload", "CLP"}, {"clbWrapper", "CLW"}},
96+
}};
97+
98+
std::vector<DataProcessorInfo> metadataOut{
99+
{"A", "test_Framework_test_SerializationWorkflow", {}},
100+
};
101+
102+
CommandInfo commandInfoOut{"o2-dpl-workflow -b --option 1 --option 2"};
103+
104+
std::vector<DataProcessorInfo> metadataIn{};
105+
CommandInfo commandInfoIn;
106+
107+
std::ostringstream firstDump;
108+
WorkflowSerializationHelpers::dump(firstDump, w0, metadataOut, commandInfoOut);
109+
std::istringstream is;
110+
is.str(firstDump.str());
111+
WorkflowSpec w1;
112+
WorkflowSerializationHelpers::import(is, w1, metadataIn, commandInfoIn);
113+
114+
std::ostringstream secondDump;
115+
WorkflowSerializationHelpers::dump(secondDump, w1, metadataIn, commandInfoIn);
116+
117+
BOOST_REQUIRE_EQUAL(w0.size(), 1);
118+
BOOST_REQUIRE_EQUAL(w0.size(), w1.size());
119+
BOOST_CHECK_EQUAL(firstDump.str(), secondDump.str());
120+
BOOST_CHECK_EQUAL(commandInfoIn.command, commandInfoOut.command);
121+
122+
// also check if the conversion to ConcreteDataMatcher is working at import
123+
// BOOST_CHECK(std::get_if<ConcreteDataTypeMatcher>(&w1[0].inputs[0].matcher) != nullptr);
124+
}

0 commit comments

Comments
 (0)