From 9be0ac031fd016f768297b3647a4b786aa7ae5b6 Mon Sep 17 00:00:00 2001 From: Eddie Louie Date: Tue, 1 Aug 2017 20:16:10 -0400 Subject: SERVER-29135 Add post-image lookup to $changeNotification This reverts commit 2a76bd75d75197d3604643ff2b11d0a8f23c14f9. --- src/mongo/db/pipeline/document_source_bucket_test.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/mongo/db/pipeline/document_source_bucket_test.cpp') diff --git a/src/mongo/db/pipeline/document_source_bucket_test.cpp b/src/mongo/db/pipeline/document_source_bucket_test.cpp index 1a61934dcb5..26f18c4dca9 100644 --- a/src/mongo/db/pipeline/document_source_bucket_test.cpp +++ b/src/mongo/db/pipeline/document_source_bucket_test.cpp @@ -47,21 +47,22 @@ namespace mongo { namespace { -using std::vector; using boost::intrusive_ptr; +using std::list; +using std::vector; class BucketReturnsGroupAndSort : public AggregationContextFixture { public: void testCreateFromBsonResult(BSONObj bucketSpec, Value expectedGroupExplain) { - vector> result = + list> result = DocumentSourceBucket::createFromBson(bucketSpec.firstElement(), getExpCtx()); ASSERT_EQUALS(result.size(), 2UL); - const auto* groupStage = dynamic_cast(result[0].get()); + const auto* groupStage = dynamic_cast(result.front().get()); ASSERT(groupStage); - const auto* sortStage = dynamic_cast(result[1].get()); + const auto* sortStage = dynamic_cast(result.back().get()); ASSERT(sortStage); // Serialize the DocumentSourceGroup and DocumentSourceSort from $bucket so that we can @@ -154,7 +155,7 @@ TEST_F(BucketReturnsGroupAndSort, BucketSucceedsWithMultipleBoundaryValues) { class InvalidBucketSpec : public AggregationContextFixture { public: - vector> createBucket(BSONObj bucketSpec) { + list> createBucket(BSONObj bucketSpec) { auto sources = DocumentSourceBucket::createFromBson(bucketSpec.firstElement(), getExpCtx()); return sources; } @@ -267,14 +268,14 @@ TEST_F(InvalidBucketSpec, GroupFailsForBucketWithInvalidOutputField) { TEST_F(InvalidBucketSpec, SwitchFailsForBucketWhenNoDefaultSpecified) { const auto spec = fromjson("{$bucket : {groupBy : '$x', boundaries : [1, 2, 3]}}"); - vector> bucketStages = createBucket(spec); + list> bucketStages = createBucket(spec); ASSERT_EQUALS(bucketStages.size(), 2UL); - auto* groupStage = dynamic_cast(bucketStages[0].get()); + auto* groupStage = dynamic_cast(bucketStages.front().get()); ASSERT(groupStage); - const auto* sortStage = dynamic_cast(bucketStages[1].get()); + const auto* sortStage = dynamic_cast(bucketStages.back().get()); ASSERT(sortStage); auto doc = Document{{"x", 4}}; -- cgit v1.2.1