summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/aggregation_context_fixture.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/aggregation_context_fixture.h')
-rw-r--r--src/mongo/db/pipeline/aggregation_context_fixture.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/aggregation_context_fixture.h b/src/mongo/db/pipeline/aggregation_context_fixture.h
index 76cc01a40c4..e7595382094 100644
--- a/src/mongo/db/pipeline/aggregation_context_fixture.h
+++ b/src/mongo/db/pipeline/aggregation_context_fixture.h
@@ -33,6 +33,7 @@
#include <memory>
#include "mongo/db/concurrency/locker_noop_client_observer.h"
+#include "mongo/db/pipeline/document_source.h"
#include "mongo/db/pipeline/expression_context_for_test.h"
#include "mongo/db/service_context_test_fixture.h"
#include "mongo/unittest/temp_dir.h"
@@ -76,6 +77,14 @@ private:
boost::intrusive_ptr<ExpressionContextForTest> _expCtx;
};
+// A custom-deleter which disposes a DocumentSource when it goes out of scope.
+struct DocumentSourceDeleter {
+ void operator()(DocumentSource* docSource) {
+ docSource->dispose();
+ delete docSource;
+ }
+};
+
class ServerlessAggregationContextFixture : public AggregationContextFixture {
public:
ServerlessAggregationContextFixture()