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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 2.7.3
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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())
      

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

                Created:
                Updated:
                Resolved: