diff options
author | Eddie Louie <eddie.louie@mongodb.com> | 2017-08-01 20:16:10 -0400 |
---|---|---|
committer | Eddie Louie <eddie.louie@mongodb.com> | 2017-08-01 20:16:10 -0400 |
commit | 9be0ac031fd016f768297b3647a4b786aa7ae5b6 (patch) | |
tree | 6ec2bf60813939c58d5dbb09daf2ebefbd483469 /src/mongo/db/pipeline/document_source_bucket_test.cpp | |
parent | fd01541d77ca1455c603c411f395d6ce34fab6f1 (diff) | |
download | mongo-9be0ac031fd016f768297b3647a4b786aa7ae5b6.tar.gz |
SERVER-29135 Add post-image lookup to $changeNotification
This reverts commit 2a76bd75d75197d3604643ff2b11d0a8f23c14f9.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_bucket_test.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_bucket_test.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
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<intrusive_ptr<DocumentSource>> result = + list<intrusive_ptr<DocumentSource>> result = DocumentSourceBucket::createFromBson(bucketSpec.firstElement(), getExpCtx()); ASSERT_EQUALS(result.size(), 2UL); - const auto* groupStage = dynamic_cast<DocumentSourceGroup*>(result[0].get()); + const auto* groupStage = dynamic_cast<DocumentSourceGroup*>(result.front().get()); ASSERT(groupStage); - const auto* sortStage = dynamic_cast<DocumentSourceSort*>(result[1].get()); + const auto* sortStage = dynamic_cast<DocumentSourceSort*>(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<intrusive_ptr<DocumentSource>> createBucket(BSONObj bucketSpec) { + list<intrusive_ptr<DocumentSource>> 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<intrusive_ptr<DocumentSource>> bucketStages = createBucket(spec); + list<intrusive_ptr<DocumentSource>> bucketStages = createBucket(spec); ASSERT_EQUALS(bucketStages.size(), 2UL); - auto* groupStage = dynamic_cast<DocumentSourceGroup*>(bucketStages[0].get()); + auto* groupStage = dynamic_cast<DocumentSourceGroup*>(bucketStages.front().get()); ASSERT(groupStage); - const auto* sortStage = dynamic_cast<DocumentSourceSort*>(bucketStages[1].get()); + const auto* sortStage = dynamic_cast<DocumentSourceSort*>(bucketStages.back().get()); ASSERT(sortStage); auto doc = Document{{"x", 4}}; |