<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTExpectFailureWithOptionsInBlock",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:@F@XCTExpectFailureWithOptionsInBlock"
  },
  "title" : "XCTExpectFailureWithOptionsInBlock"
}
-->

# XCTExpectFailureWithOptionsInBlock

Instructs the test to expect a failure in an assertion in the provided block of code, with options to customize expected failure checking and handling.

```
extern void XCTExpectFailureWithOptionsInBlock(NSString *failureReason, XCTExpectedFailureOptions *options, void (^failingBlock)());
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)