---
title: XCTExpectFailureInBlock
framework: xctest
role: symbol
role_heading: Function
path: xctest/xctexpectfailureinblock
---

# XCTExpectFailureInBlock

Instructs the test to expect a failure in an assertion in the provided block of code.

## Declaration

```occ
extern void XCTExpectFailureInBlock(NSString *failureReason, void (^failingBlock)());
```

## See Also

### Expected Failures

- [XCTExpectedFailure](xctest/xctexpectedfailure.md)
- [XCTExpectedFailure.Options](xctest/xctexpectedfailure/options.md)
- [XCTExpectFailure](xctest/xctexpectfailure.md)
- [XCTExpectFailureWithOptions](xctest/xctexpectfailurewithoptions.md)
- [XCTExpectFailureWithOptionsInBlock](xctest/xctexpectfailurewithoptionsinblock.md)
