XCTest.waitForExpectationsWithTimeout should accept file and line parameters

Originator:heath.borders
Number:rdar://20235019 Date Originated:19-Mar-2015 11:27 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode Version 6.2 (6C131e)
Classification:Enhancement Reproducible:N/A
 
Summary:
If I accidentally call XCTest.waitForExpectationsWithTimeout without creating an expectation, I get the following error:
Assertions:  failed: caught "NSInternalInconsistencyException", "API violation - call made to wait without any expectations having been set."

This doesn't crash tests, it acts like an XCTFail. Thus, XCTest.waitForExpectationsWithTimeout should accept file and line parameters so that callers can see exactly where their erroneous XCTest.waitForExpectationsWithTimeout call is.

Steps to Reproduce:
1. call XCTest.waitForExpectationsWithTimeout without creating an expectation
2. run tests

Expected Results:
See a failure marker where I called XCTest.waitForExpectationsWithTimeout

Actual Results:
Unspecific failure on the whole test method only. No clue as to what caused the failure other than the following output:
Assertions:  failed: caught "NSInternalInconsistencyException", "API violation - call made to wait without any expectations having been set."

Version:
Xcode Version 6.2 (6C131e)

Notes:


Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!