From 368f337eae2aab77b727fb91beb2d2bdd64ac53a Mon Sep 17 00:00:00 2001 From: James Wahlin Date: Tue, 14 Nov 2017 16:16:01 -0500 Subject: SERVER-31962 Replace Variables::hasUserDefinedValue() with const val chk --- src/mongo/db/pipeline/expression_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mongo/db/pipeline/expression_test.cpp') diff --git a/src/mongo/db/pipeline/expression_test.cpp b/src/mongo/db/pipeline/expression_test.cpp index 6ada15ea651..b893229d6f0 100644 --- a/src/mongo/db/pipeline/expression_test.cpp +++ b/src/mongo/db/pipeline/expression_test.cpp @@ -2228,7 +2228,7 @@ TEST(FieldPath, NoOptimizationOnNormalPath) { TEST(FieldPath, OptimizeOnVariableWithConstantScalarValue) { intrusive_ptr expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(123)); + expCtx->variables.setConstantValue(varId, Value(123)); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast(expr.get())); @@ -2240,7 +2240,7 @@ TEST(FieldPath, OptimizeOnVariableWithConstantScalarValue) { TEST(FieldPath, OptimizeOnVariableWithConstantArrayValue) { intrusive_ptr expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(BSON_ARRAY(1 << 2 << 3))); + expCtx->variables.setConstantValue(varId, Value(BSON_ARRAY(1 << 2 << 3))); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast(expr.get())); @@ -2254,7 +2254,7 @@ TEST(FieldPath, OptimizeOnVariableWithConstantArrayValue) { TEST(FieldPath, OptimizeToEmptyArrayOnNumericalPathComponentAndConstantArrayValue) { intrusive_ptr expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(BSON_ARRAY(1 << 2 << 3))); + expCtx->variables.setConstantValue(varId, Value(BSON_ARRAY(1 << 2 << 3))); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar.1", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast(expr.get())); @@ -2268,7 +2268,7 @@ TEST(FieldPath, OptimizeToEmptyArrayOnNumericalPathComponentAndConstantArrayValu TEST(FieldPath, OptimizeOnVariableWithConstantValueAndDottedPath) { intrusive_ptr expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(Document{{"x", Document{{"y", 123}}}})); + expCtx->variables.setConstantValue(varId, Value(Document{{"x", Document{{"y", 123}}}})); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar.x.y", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast(expr.get())); @@ -2305,7 +2305,7 @@ TEST(FieldPath, NoOptimizationOnVariableWithMissingValue) { TEST(FieldPath, ScalarVariableWithDottedFieldPathOptimizesToConstantMissingValue) { intrusive_ptr expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(123)); + expCtx->variables.setConstantValue(varId, Value(123)); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar.x.y", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast(expr.get())); -- cgit v1.2.1