Skip to content

Commit

Permalink
Revert "DPL: add wildcards when creating matchers via DataDescriptorM…
Browse files Browse the repository at this point in the history
…atcher::parse (#5413)" (#5596)

This reverts commit 68461c3.
  • Loading branch information
ktf authored Mar 3, 2021
1 parent 378363c commit 9ad45ec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
12 changes: 0 additions & 12 deletions Framework/Core/src/DataDescriptorQueryBuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ std::vector<InputSpec> DataDescriptorQueryBuilder::parse(char const* config)
auto lastMatcher =
std::make_unique<DataDescriptorMatcher>(DataDescriptorMatcher::Op::Just,
StartTimeValueMatcher(ContextRef{0}));
size_t extraNodes = 0;
if (nodes.size() <= 1) {
nodes.push_back(DescriptionValueMatcher{ContextRef{++extraNodes}});
}
if (nodes.size() <= 2) {
nodes.push_back(SubSpecificationTypeValueMatcher{ContextRef{++extraNodes}});
}

for (size_t ni = 0, ne = nodes.size(); ni < ne; ++ni) {
auto& node = nodes[nodes.size() - 1 - ni];
auto tmp = std::make_unique<DataDescriptorMatcher>(DataDescriptorMatcher::Op::And,
Expand Down Expand Up @@ -195,8 +187,6 @@ std::vector<InputSpec> DataDescriptorQueryBuilder::parse(char const* config)
case IN_END_DESCRIPTION: {
if (assignLastStringMatch("description", 16, currentDescription, IN_BEGIN_SUBSPEC)) {
nodes.push_back(DescriptionValueMatcher{*currentDescription});
} else {
nodes.push_back(DescriptionValueMatcher{ContextRef{1}});
}
} break;
case IN_BEGIN_SUBSPEC: {
Expand All @@ -206,8 +196,6 @@ std::vector<InputSpec> DataDescriptorQueryBuilder::parse(char const* config)
case IN_END_SUBSPEC: {
if (assignLastNumericMatch("subspec", currentSubSpec, IN_BEGIN_TIMEMODULO)) {
nodes.push_back(SubSpecificationTypeValueMatcher{*currentSubSpec});
} else {
nodes.push_back(SubSpecificationTypeValueMatcher{ContextRef{2}});
}
} break;
case IN_BEGIN_TIMEMODULO: {
Expand Down
40 changes: 0 additions & 40 deletions Framework/Core/test/test_DataDescriptorMatcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -605,43 +605,3 @@ BOOST_AUTO_TEST_CASE(DataQuery)
<< DataDescriptorMatcher::Op::Just;
BOOST_CHECK_EQUAL(ops.str(), "andorxorjust");
}

BOOST_AUTO_TEST_CASE(CheckOriginWildcard)
{
auto result0 = DataDescriptorQueryBuilder::parse("x:TST");
BOOST_CHECK_EQUAL(result0.size(), 1);
DataDescriptorMatcher expectedMatcher00{
DataDescriptorMatcher::Op::And,
OriginValueMatcher{"TST"},
std::make_unique<DataDescriptorMatcher>(
DataDescriptorMatcher::Op::And,
DescriptionValueMatcher{ContextRef{1}},
std::make_unique<DataDescriptorMatcher>(
DataDescriptorMatcher::Op::And,
SubSpecificationTypeValueMatcher{ContextRef{2}},
std::make_unique<DataDescriptorMatcher>(DataDescriptorMatcher::Op::Just,
StartTimeValueMatcher{ContextRef{0}})))};
auto matcher = std::get_if<DataDescriptorMatcher>(&result0[0].matcher);
BOOST_REQUIRE(matcher != nullptr);
BOOST_CHECK_EQUAL(expectedMatcher00, *matcher);
}

BOOST_AUTO_TEST_CASE(CheckOriginDescriptionWildcard)
{
auto result0 = DataDescriptorQueryBuilder::parse("x:TST/A");
BOOST_CHECK_EQUAL(result0.size(), 1);
DataDescriptorMatcher expectedMatcher00{
DataDescriptorMatcher::Op::And,
OriginValueMatcher{"TST"},
std::make_unique<DataDescriptorMatcher>(
DataDescriptorMatcher::Op::And,
DescriptionValueMatcher{"A"},
std::make_unique<DataDescriptorMatcher>(
DataDescriptorMatcher::Op::And,
SubSpecificationTypeValueMatcher{ContextRef{1}},
std::make_unique<DataDescriptorMatcher>(DataDescriptorMatcher::Op::Just,
StartTimeValueMatcher{ContextRef{0}})))};
auto matcher = std::get_if<DataDescriptorMatcher>(&result0[0].matcher);
BOOST_REQUIRE(matcher != nullptr);
BOOST_CHECK_EQUAL(expectedMatcher00, *matcher);
}

0 comments on commit 9ad45ec

Please sign in to comment.