summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/expression_and_test.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2022-08-15 17:46:43 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-15 18:51:49 +0000
commit5e8be83c97583194f9ea0a9b7ce2db10d90cf009 (patch)
treea214a73a2190dfd69444e63bf487819de9bf6144 /src/mongo/db/pipeline/expression_and_test.cpp
parentbdc3e68c00a1bd88d14dacf4cf828cbc88a77efe (diff)
downloadmongo-5e8be83c97583194f9ea0a9b7ce2db10d90cf009.tar.gz
SERVER-68820 Move temp collection cleanup paths out of Database
Diffstat (limited to 'src/mongo/db/pipeline/expression_and_test.cpp')
-rw-r--r--src/mongo/db/pipeline/expression_and_test.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/mongo/db/pipeline/expression_and_test.cpp b/src/mongo/db/pipeline/expression_and_test.cpp
index 4451dee15cf..46bdd07dd90 100644
--- a/src/mongo/db/pipeline/expression_and_test.cpp
+++ b/src/mongo/db/pipeline/expression_and_test.cpp
@@ -27,8 +27,6 @@
* it in the license file.
*/
-#include "mongo/platform/basic.h"
-
#include "mongo/bson/bsonmisc.h"
#include "mongo/config.h"
#include "mongo/db/exec/document_value/document.h"
@@ -44,7 +42,6 @@
namespace mongo {
namespace ExpressionTests {
namespace {
-using boost::intrusive_ptr;
/** Convert BSONObj to a BSONObj with our $const wrappings. */
static BSONObj constify(const BSONObj& obj, bool parentIsArray = false) {
@@ -58,7 +55,7 @@ static BSONObj constify(const BSONObj& obj, bool parentIsArray = false) {
// parser
bob << elem.fieldName() << BSONArray(constify(elem.Obj(), true));
} else if (elem.fieldNameStringData() == "$const" ||
- (elem.type() == mongo::String && elem.valueStringDataSafe().startsWith("$"))) {
+ (elem.type() == String && elem.valueStringDataSafe().startsWith("$"))) {
bob.append(elem);
} else {
bob.append(elem.fieldName(), BSON("$const" << elem));
@@ -75,7 +72,7 @@ static BSONObj toBson(const Value& value) {
}
/** Convert Expression to BSON. */
-static BSONObj expressionToBson(const intrusive_ptr<Expression>& expression) {
+static BSONObj expressionToBson(const boost::intrusive_ptr<Expression>& expression) {
return BSON("" << expression->serialize(false)).firstElement().embeddedObject().getOwned();
}
@@ -105,12 +102,13 @@ public:
BSONObj specObject = BSON("" << spec());
BSONElement specElement = specObject.firstElement();
VariablesParseState vps = expCtx.variablesParseState;
- intrusive_ptr<Expression> expression = Expression::parseOperand(&expCtx, specElement, vps);
+ boost::intrusive_ptr<Expression> expression =
+ Expression::parseOperand(&expCtx, specElement, vps);
ASSERT_BSONOBJ_EQ(constify(spec()), expressionToBson(expression));
ASSERT_BSONOBJ_EQ(
BSON("" << expectedResult()),
toBson(expression->evaluate(fromBson(BSON("a" << 1)), &expCtx.variables)));
- intrusive_ptr<Expression> optimized = expression->optimize();
+ boost::intrusive_ptr<Expression> optimized = expression->optimize();
ASSERT_BSONOBJ_EQ(BSON("" << expectedResult()),
toBson(optimized->evaluate(fromBson(BSON("a" << 1)), &expCtx.variables)));
}
@@ -128,9 +126,10 @@ public:
BSONObj specObject = BSON("" << spec());
BSONElement specElement = specObject.firstElement();
VariablesParseState vps = expCtx.variablesParseState;
- intrusive_ptr<Expression> expression = Expression::parseOperand(&expCtx, specElement, vps);
+ boost::intrusive_ptr<Expression> expression =
+ Expression::parseOperand(&expCtx, specElement, vps);
ASSERT_BSONOBJ_EQ(constify(spec()), expressionToBson(expression));
- intrusive_ptr<Expression> optimized = expression->optimize();
+ boost::intrusive_ptr<Expression> optimized = expression->optimize();
ASSERT_BSONOBJ_EQ(expectedOptimized(), expressionToBson(optimized));
}
@@ -392,7 +391,7 @@ class NestedZero : public OptimizeBase {
} // namespace And
-class All : public OldStyleSuiteSpecification {
+class All : public unittest::OldStyleSuiteSpecification {
public:
All() : OldStyleSuiteSpecification("expression") {}
@@ -425,7 +424,7 @@ public:
}
};
-OldStyleSuiteInitializer<All> andAll;
+unittest::OldStyleSuiteInitializer<All> andAll;
} // namespace
} // namespace ExpressionTests