Xcode 5.0.2: XCTest framework does not compare primitive values correct in XCTAssertEqual

Originator:roustem
Number:rdar://16019984 Date Originated:08-Feb-2014 01:54 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 5.0.2 (5A3005)
Classification:Other Bug Reproducible:Always
 
Summary:
Integer values of different types are always reported as not being equal by XCTAssertEqual.

Steps to Reproduce:

Here is the example. All 4 tests fail:
https://twitter.com/roustem/status/432223068535021568

- (void)testExample
{
    XCTAssertEqual(2, 2u, @"Should be equal");
    XCTAssertEqual(2, 2l, @"Should be equal");
    XCTAssertEqual(2, (char)2, @"Should be equal");
    XCTAssertEqual(2, (short)2, @"Should be equal");
}


Expected Results:
XCTAssertEqual behaviour should be the same as '==' in Objective-C.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!