[SERVER-14418] Introduce unittest::assertGet(StatusWith<T>) method to facilitate testing functions that return StatusWith Created: 01/Jul/14 Updated: 11/Jul/16 Resolved: 02/Jul/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | None |
| Fix Version/s: | 2.7.3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Andy Schwerin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| 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:
|
| Comments |
| Comment by Githook User [ 02/Jul/14 ] |
|
Author: {u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}Message: |