---
title: XCTAssert
framework: xctest
role: symbol
role_heading: Macro
path: xctest/xctassert
---

# XCTAssert

Asserts that an expression is true.

## Declaration

```occ
#define XCTAssert(expression, ...)
```

## Parameters

- `expression`: An expression of Boolean type.
- `…`: An optional description of the failure. A literal doc://com.apple.documentation/documentation/Foundation/NSString, optionally with string format specifiers.

## Discussion

Discussion This function generates a failure when expression == false and is equivalent to XCTAssertTrue.

## See Also

### Tests for True Conditions

- [XCTAssertTrue](xctest/xctasserttrue.md)
