Waitforexpectationswithtimeout handler

Posted: Kupec Date of post: 23.05.2017

uqyhadet.web.fc2.com - XCTestCaseAsync Class Reference

I am trying to test an asynchronous request with XCTest and so using expectationWithDescription:. Yet when waitForExpectationsWithTimeout is called it immediately crashes without even waiting for the timeout. I even tried putting the fulfill operation soon after just to exclude a timeout issue, but it di no change things; this is my function:.

waitforexpectationswithtimeout handler

The same behavior happens in other functions. If I take away the waitForExpectationsWithTimeout operation and keep the expectationWithDescription operation, it crashes at the end of the function.

In both case the crash repot is the following:. You can try to provide implementation for the handler. As per docs handler parameter is not optional in waitForExpectationsWithTimeout markup:. Also you could try to follow this post and see whether you get more appropriate crash log. By posting your answer, you agree to the privacy policy and terms of service.

By subscribing, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list.

Asynchronous Xcode UI Testing - uqyhadet.web.fc2.com

Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us. Log In Sign Up.

How to Use iOS Expectations to Test Async Functions Without a Callback Method - Savvy Apps

Join the Stack Overflow Community. Stack Overflow is a community of 7.

Join them; it only takes a minute: I even tried putting the fulfill operation soon after just to exclude a timeout issue, but it di no change things; this is my function: In both case the crash repot is the following: Fabrizio Bartolomucci 1, 4 22 As per docs handler parameter is not optional in waitForExpectationsWithTimeout markup: Therefore you can try to provide explicity unwrapped handler even empty one will do the job: Yes, I did it actually putting waitForExpectationsWithTimeout at the end of the function as hinted in the WWDC I just viewed and for some reason all test resolve correctly.

The crash seems to be connected to some test failures, but I was not able to understand when this happens. Anyway my experience is that when there is no failed test there is also no strange crash. I did not need to provide an handler though. I am submitting an answer with the working code.

XCTestCase / XCTestExpectation / measureBlock() - NSHipster

I watched the specific talk in WWDC14 and came out with the following implementation: Sign up or log in StackExchange. Sign up using Facebook.

Sign up using Email and Password. Post as a guest Name.

waitforexpectationswithtimeout handler

In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers. Stack Overflow works best with JavaScript enabled. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

Rating 4,5 stars - 890 reviews
inserted by FC2 system