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

Introduce unittest::assertGet(StatusWith<T>) method to facilitate testing functions that return StatusWith

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.3
    • Component/s: Testing Infrastructure
    • Labels:
      None

      Description

      Per the summary, it is often convenient to write tests that assert both that a method returning StatusWith<T> succeeds and checks the value of the returned T. assertGet(StatusWith<T> swt) should ASSERT_OK(swt.getStatus()) and then return swt.getValue(), so that you can write:

      ASSERT_EQUALS(someVal, unittest::assertGet(someStatusWithMethod())

        Attachments

          Activity

            People

            Assignee:
            schwerin Andy Schwerin
            Reporter:
            schwerin Andy Schwerin
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: