Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6912

Use smart pointers in dbtests/jstests.cpp for Scope variables

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Testing Infrastructure
    • Fully Compatible

    Description

      In dbtests/jstests.cpp many of the tests have something like:

      Scope * s = globalScopeEngine->newScope();
      ...
      delete s;

      This should be changed so that instead of having a normal pointer for s, we use a smart pointer. This also means that we will not have to have the delete call at the end of each test.

      Though this method works, it is not exception safe and is not really in line with best practices. Additionally, it seems desirable to have consistency throughout the code base (even in tests) regarding the (non)use of delete

      Attachments

        Activity

          People

            Unassigned Unassigned
            andrew.emil@10gen.com Andrew Emil (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: