---
title: XCTAssertNotEqual
framework: xctest
role: symbol
role_heading: Macro
path: xctest/xctassertnotequal
---

# XCTAssertNotEqual

Asserts that two expressions don’t have the same value.

## Declaration

```occ
#define XCTAssertNotEqual(expression1, expression2, ...)
```

## Parameters

- `expression1`: An expression of C scalar type.
- `expression2`: A second expression of C scalar type.
- `…`: An optional description of a failure. A literal doc://com.apple.documentation/documentation/Foundation/NSString, optionally with string format specifiers.

## Discussion

Discussion Generates a failure when expression1 == expression2.

## See Also

### Tests for Equality and Inequality

- [XCTAssertEqual](xctest/xctassertequal.md)
- [XCTAssertEqualObjects](xctest/xctassertequalobjects.md)
- [XCTAssertNotEqualObjects](xctest/xctassertnotequalobjects.md)
