The following issues were found

src/mongo/s/commands/cluster_find_and_modify_test.cpp
1 issues
syntax error
Error

Line: 68

                  }
};

TEST_F(ClusterFindAndModifyTest, NoErrors) {
    testNoErrors(kFindAndModifyCmdTargeted);
}

TEST_F(ClusterFindAndModifyTest, RetryOnSnapshotError) {
    testRetryOnSnapshotError(kFindAndModifyCmdTargeted);

            

Reported by Cppcheck.

src/mongo/s/commands/cluster_find_test.cpp
1 issues
syntax error
Error

Line: 82

                  }
};

TEST_F(ClusterFindTest, NoErrors) {
    testNoErrors(kFindCmdTargeted, kFindCmdScatterGather);
}

TEST_F(ClusterFindTest, RetryOnSnapshotError) {
    testRetryOnSnapshotError(kFindCmdTargeted, kFindCmdScatterGather);

            

Reported by Cppcheck.

src/mongo/s/commands/cluster_insert_test.cpp
1 issues
syntax error
Error

Line: 71

                  }
};

TEST_F(ClusterInsertTest, NoErrors) {
    testNoErrors(kInsertCmdTargeted, kInsertCmdScatterGather);
}

TEST_F(ClusterInsertTest, AttachesAtClusterTimeForSnapshotReadConcern) {
    testAttachesAtClusterTimeForSnapshotReadConcern(kInsertCmdTargeted, kInsertCmdScatterGather);

            

Reported by Cppcheck.

src/mongo/s/commands/cluster_update_test.cpp
1 issues
syntax error
Error

Line: 75

                  }
};

TEST_F(ClusterUpdateTest, NoErrors) {
    testNoErrors(kUpdateCmdTargeted, kUpdateCmdScatterGather);
}

TEST_F(ClusterUpdateTest, AttachesAtClusterTimeForSnapshotReadConcern) {
    testAttachesAtClusterTimeForSnapshotReadConcern(kUpdateCmdTargeted, kUpdateCmdScatterGather);

            

Reported by Cppcheck.

src/mongo/s/commands/cluster_validate_db_metadata_cmd_test.cpp
1 issues
syntax error
Error

Line: 74

                  bool hasMoreErrors = false;
};

TEST_F(ClusterValidateDBMetadataTest, AppendsErrorsFromShards) {
    apiVersionErrorsShard1 = {BSON("ns"
                                   << "test.ns"
                                   << "code" << 9 << "codeName"
                                   << "APIStrictError"
                                   << "errmsg"

            

Reported by Cppcheck.

src/mongo/s/commands/document_shard_key_update_test.cpp
1 issues
syntax error
Error

Line: 52

                  DocumentShardKeyUpdateTest() {}
};

TEST_F(DocumentShardKeyUpdateTest, constructShardKeyDeleteCmdObj) {
    NamespaceString nss("test.foo");
    BSONObj updatePreImage = BSON("x" << 4 << "y" << 3 << "_id" << 20);

    auto deleteCmdObj = constructShardKeyDeleteCmdObj(nss, updatePreImage);


            

Reported by Cppcheck.

src/mongo/s/comparable_chunk_version_test.cpp
1 issues
syntax error
Error

Line: 51

                  versionsEqual(ChunkVersion(1, 0, epoch, Timestamp(1)), ChunkVersion(1, 0, epoch, Timestamp(1)));
}

TEST(ComparableChunkVersionTest, VersionsEqualAfterCopy) {
    auto equalAfterCopy = [](const ChunkVersion& v) {
        const auto version1 = ComparableChunkVersion::makeComparableChunkVersion(v);
        const auto version2 = version1;
        ASSERT(version1 == version2);
    };

            

Reported by Cppcheck.

src/mongo/s/comparable_database_version_test.cpp
1 issues
syntax error
Error

Line: 45

                  ASSERT(version == version);
}

TEST(ComparableDatabaseVersionTest, VersionsEqualAfterCopy) {
    const DatabaseVersion v(UUID::gen(), Timestamp(1));
    const auto version1 = ComparableDatabaseVersion::makeComparableDatabaseVersion(v);
    const auto version2 = version1;
    ASSERT(version1 == version2);
}

            

Reported by Cppcheck.

src/mongo/s/hedge_options_util_test.cpp
1 issues
syntax error
Error

Line: 106

                  ServiceContext::UniqueClient _client = _serviceCtx->makeClient("RemoteCommandRequestTest");
};

TEST_F(HedgeOptionsUtilTestFixture, ExplicitOperationHedging) {
    const auto parameters = BSONObj();
    const auto cmdObj = BSON("find" << kCollName);
    const auto rspObj = BSON("mode"
                             << "primaryPreferred"
                             << "hedge" << BSONObj());

            

Reported by Cppcheck.

src/mongo/s/mongos_topology_coordinator_test.cpp
1 issues
syntax error
Error

Line: 89

                  std::shared_ptr<ClockSourceMock> _clkSource = std::make_shared<ClockSourceMock>();
};

TEST_F(MongosTopoCoordTest, MongosTopologyVersionCounterInitializedAtStartup) {
    ASSERT_EQ(0, getTopoCoord().getTopologyVersion().getCounter());
}

TEST_F(MongosTopoCoordTest, AwaitHelloReturnsCorrectFieldTypes) {
    std::string mongosString = "isdbgrid";

            

Reported by Cppcheck.