The following issues were found
src/mongo/db/exec/sbe/expressions/sbe_to_upper_to_lower_test.cpp
1 issues
Line: 53
}
};
TEST_F(SBEToUpperToLowerTest, BasicToUpper) {
value::OwnedValueAccessor toUpperAccessor;
auto toUpperSlot = bindAccessor(&toUpperAccessor);
auto toUpperExpr =
sbe::makeE<sbe::EFunction>("toUpper", sbe::makeEs(makeE<EVariable>(toUpperSlot)));
auto compiledExpr = compileExpression(*toUpperExpr);
Reported by Cppcheck.
src/mongo/db/exec/sbe/expressions/sbe_trigonometric_expressions_test.cpp
1 issues
Line: 62
}
};
TEST_F(SBETrigonometricExprTest, ComputesAcos) {
value::OwnedValueAccessor slotAccessor;
auto argSlot = bindAccessor(&slotAccessor);
auto acosExpr = sbe::makeE<sbe::EFunction>("acos", sbe::makeEs(makeE<EVariable>(argSlot)));
auto compiledExpr = compileExpression(*acosExpr);
Reported by Cppcheck.
src/mongo/db/exec/sbe/expressions/sbe_trunc_builtin_test.cpp
1 issues
Line: 77
}
};
TEST_F(SBETruncBuiltinTest, TestIntegers) {
std::vector<int64_t> testCases = {1234, 0, -1234};
for (const auto& argument : testCases) {
runAndAssertExpression(value::TypeTags::NumberInt32,
value::bitcastFrom<int64_t>(argument),
Reported by Cppcheck.
src/mongo/db/exec/sbe/expressions/sbe_ts_second_ts_increment_test.cpp
1 issues
Line: 72
using SBEBuiltinTsSecondTest = SBEBuiltinTsExpressionBase;
using SBEBuiltinTsIncrementTest = SBEBuiltinTsExpressionBase;
TEST_F(SBEBuiltinTsSecondTest, HandlesTimestamp) {
auto timestamp = Timestamp(1622731060, 10);
auto sbeTimestamp = makeTimestamp(timestamp);
auto expectedSecs = makeInt64(timestamp.getSecs());
value::ValueGuard guardSbeTimestamp{sbeTimestamp};
Reported by Cppcheck.
src/mongo/db/exec/sbe/parser/sbe_parser_test.cpp
1 issues
Line: 588
std::vector<std::unique_ptr<sbe::PlanStage>> stages;
};
TEST_F(SBEParserTest, TestIdenticalDebugOutputAfterParse) {
sbe::DebugPrinter printer;
for (const auto& stage : stages) {
auto env = std::make_unique<sbe::RuntimeEnvironment>();
sbe::Parser parser(env.get());
Reported by Cppcheck.
src/mongo/db/exec/sbe/sbe_filter_test.cpp
1 issues
Line: 67
runTest(inputTag, inputVal, expectedTag, expectedVal, makeStageFn);
}
TEST_F(FilterStageTest, ConstantFilterAlwaysFalseTest) {
auto [inputTag, inputVal] = stage_builder::makeValue(
BSON_ARRAY(12LL << "yar" << BSON_ARRAY(2.5) << 7.5 << BSON("foo" << 23)));
value::ValueGuard inputGuard{inputTag, inputVal};
auto [expectedTag, expectedVal] = value::makeNewArray();
Reported by Cppcheck.
src/mongo/db/exec/sbe/sbe_key_string_test.cpp
1 issues
Line: 53
BOB.append(NAME "-descending", VALUE); \
} while (false);
TEST_F(SBEKeyStringTest, Basic) {
// Add interesting values to a BSON object. Note that we add each value twice: one will have an
// "ascending" ordering, and the other will have a "descending" ordering.
BSONObjBuilder bob;
APPEND_TWICE(bob, "zeroInt", 0);
APPEND_TWICE(bob, "oneByteInt", 0x10);
Reported by Cppcheck.
src/mongo/db/exec/sbe/sbe_limit_skip_test.cpp
1 issues
Line: 61
ASSERT_TRUE(limit->getNext() == PlanState::IS_EOF);
}
TEST_F(LimitSkipStageTest, LimitSkipSimpleTest) {
auto ctx = makeCompileCtx();
// Make an input array containing 64-integers 0 thru 999, inclusive.
auto [inputTag, inputVal] = value::makeNewArray();
value::ValueGuard inputGuard{inputTag, inputVal};
Reported by Cppcheck.
src/mongo/db/exec/sbe/sbe_math_builtins_test.cpp
1 issues
Line: 107
}
}
TEST_F(SBEMathBuiltinTest, Ceil) {
value::OwnedValueAccessor inputAccessor;
auto inputSlot = bindAccessor(&inputAccessor);
auto callExpr = makeE<EFunction>("ceil", makeEs(makeE<EVariable>(inputSlot)));
auto compiledExpr = compileExpression(*callExpr);
Reported by Cppcheck.
src/mongo/db/exec/sbe/sbe_merge_join_test.cpp
1 issues
Line: 108
}
};
TEST_F(MergeJoinStageTest, MergeJoinManyToManyIdenticalKeys) {
auto outerData =
BSON_ARRAY(BSON_ARRAY(1 << BSON_ARRAY(1 << 1))
<< BSON_ARRAY(1 << BSON_ARRAY(2 << 2)) << BSON_ARRAY(1 << BSON_ARRAY(3 << 3)));
auto innerData = BSON_ARRAY(BSON_ARRAY(1 << BSON_ARRAY("a"
<< "a"))
Reported by Cppcheck.