<!--
{
  "availability" : [

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

# XCTAssertIdentical

Asserts that two values are identical.

```
#define XCTAssertIdentical(expression1, expression2, ...)
```

## Parameters

`expression1`

An expression of type `id`.

`expression2`

A second expression of type `id`.

`…`

An optional description of a failure. A literal <doc://com.apple.documentation/documentation/Foundation/NSString>, optionally with string format specifiers.

## Discussion

Compare two values of type `id`. The values are identical if they’re the same instance.

## See Also

[`XCTAssertEqualObjects`](/documentation/XCTest/XCTAssertEqualObjects)

Asserts that two objects are equal.



---

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)