The following issues were found
src/mongo/db/storage/record_store_test_datasize.cpp
1 issues
Line: 47
using std::unique_ptr;
// Verify that an empty collection takes up no space.
TEST(RecordStoreTestHarness, DataSizeEmpty) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_deleterecord.cpp
1 issues
Line: 49
using std::unique_ptr;
// Insert a record and try to delete it.
TEST(RecordStoreTestHarness, DeleteRecord) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_harness.cpp
1 issues
Line: 58
using std::string;
using std::unique_ptr;
TEST(RecordStoreTestHarness, Simple1) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_insertrecord.cpp
1 issues
Line: 46
using std::unique_ptr;
// Insert a record and verify the number of entries in the collection is 1.
TEST(RecordStoreTestHarness, InsertRecord) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_oplog.cpp
1 issues
Line: 66
return res.getValue();
}
TEST(RecordStoreTestHarness, SeekNearOplog) {
std::unique_ptr<RecordStoreHarnessHelper> harnessHelper = newRecordStoreHarnessHelper();
std::unique_ptr<RecordStore> rs(harnessHelper->newOplogRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_randomiter.cpp
1 issues
Line: 47
using std::unique_ptr;
// Create a random iterator for empty record store.
TEST(RecordStoreTestHarness, GetRandomIteratorEmpty) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_recorditer.cpp
1 issues
Line: 52
// Insert multiple records and iterate through them in the forward direction.
// When curr() or getNext() is called on an iterator positioned at EOF,
// the iterator returns RecordId() and stays at EOF.
TEST(RecordStoreTestHarness, IterateOverMultipleRecords) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_recordstore.cpp
1 issues
Line: 45
using std::unique_ptr;
// Verify that the name of the record store is not NULL and nonempty.
TEST(RecordStoreTestHarness, RecordStoreName) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
const char* name = rs->name();
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_storagesize.cpp
1 issues
Line: 46
using std::unique_ptr;
// Verify that a nonempty collection maybe takes up some space on disk.
TEST(RecordStoreTestHarness, StorageSizeNonEmpty) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.
src/mongo/db/storage/record_store_test_truncate.cpp
1 issues
Line: 46
using std::unique_ptr;
// Verify that calling truncate() on an already empty collection returns an OK status.
TEST(RecordStoreTestHarness, TruncateEmpty) {
const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
Reported by Cppcheck.