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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Unassigned
            Reporter:
            Andrew Emil (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: