EMASCurlTests/EMASCurlTimeoutTest.m [36:49]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    __block NSError *receivedError = nil;

    NSURLSessionDataTask *task = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
        receivedError = error;
        dispatch_semaphore_signal(semaphore);
    }];

    [task resume];

    XCTAssertEqual(dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC)), 0, @"Request timed out");

    XCTAssertNotNil(receivedError, @"Expected timeout error");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



EMASCurlTests/EMASCurlTimeoutTest.m [58:71]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    __block NSError *receivedError = nil;

    NSURLSessionDataTask *task = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
        receivedError = error;
        dispatch_semaphore_signal(semaphore);
    }];

    [task resume];

    XCTAssertEqual(dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC)), 0, @"Request timed out");

    XCTAssertNotNil(receivedError, @"Expected timeout error");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



