diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-03-23 10:30:23 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-03-27 16:21:01 +0200 |
commit | 3656023785d17d513b67f4cbe8686a40141e06d8 (patch) | |
tree | d3e26110f82326573c0378d74f8d1dc189b32973 /searchcore/src/tests/proton/matching | |
parent | 0cd6a2c04f90ffbdba4d585f1d71a5dd2b4e8311 (diff) |
Remove ExpressionNode::CP from interfaces.
Diffstat (limited to 'searchcore/src/tests/proton/matching')
-rw-r--r-- | searchcore/src/tests/proton/matching/matching_test.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp index ee3cb554615..a1c6538baa7 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -500,6 +500,7 @@ TEST("require that sortspec can be used (multi-threaded)") { } } +ExpressionNode::UP createAttr() { return std::make_unique<AttributeNode>("a1"); } TEST("require that grouping is performed (multi-threaded)") { for (size_t threads = 1; threads <= 16; ++threads) { MyWorld world; @@ -511,29 +512,24 @@ TEST("require that grouping is performed (multi-threaded)") { vespalib::NBOSerializer os(buf); uint32_t n = 1; os << n; - Grouping grequest = - Grouping() - .setRoot(Group() - .addResult(SumAggregationResult() - .setExpression(AttributeNode("a1")))); + Grouping grequest; + grequest.setRoot(Group().addResult(SumAggregationResult().setExpression(createAttr()))); grequest.serialize(os); request->groupSpec.assign(buf.c_str(), buf.c_str() + buf.size()); } SearchReply::UP reply = world.performSearch(request, threads); { - vespalib::nbostream buf(&reply->groupResult[0], - reply->groupResult.size()); + vespalib::nbostream buf(&reply->groupResult[0], reply->groupResult.size()); vespalib::NBOSerializer is(buf); uint32_t n; is >> n; EXPECT_EQUAL(1u, n); Grouping gresult; gresult.deserialize(is); - Grouping gexpect = Grouping() - .setRoot(Group() - .addResult(SumAggregationResult() - .setExpression(AttributeNode("a1")) - .setResult(Int64ResultNode(4500)))); + Grouping gexpect; + gexpect.setRoot(Group().addResult(SumAggregationResult() + .setExpression(createAttr()) + .setResult(Int64ResultNode(4500)))); EXPECT_EQUAL(gexpect.root().asString(), gresult.root().asString()); } EXPECT_GREATER(world.matchingStats.groupingTimeAvg(), 0.0000001); |