<!--
{
  "availability" : [

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

# XCTAssertEqual

Asserts that two expressions have the same value.

```
#define XCTAssertEqual(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

Generates a failure when `expression1 != expression2`.

---

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)