mikeash / MAObjCRuntime

ObjC wrapper for ObjC runtime API
Other
1.53k stars 191 forks source link

TestProtocolQuery fails for i386 #7

Closed rentzsch closed 12 years ago

rentzsch commented 12 years ago

Works fine for x86-64, but fails when built+run as i386: 2011-11-27 17:18:34.254 MAObjCRuntime[4644:a0f] Testing TestSubclasses 2011-11-27 17:18:34.263 MAObjCRuntime[4644:a0f] TestSubclasses: SUCCESS 2011-11-27 17:18:34.264 MAObjCRuntime[4644:a0f] Testing TestCreateClass 2011-11-27 17:18:34.264 MAObjCRuntime[4644:a0f] TestCreateClass: SUCCESS 2011-11-27 17:18:34.265 MAObjCRuntime[4644:a0f] Testing TestMetaclass 2011-11-27 17:18:34.266 MAObjCRuntime[4644:a0f] TestMetaclass: SUCCESS 2011-11-27 17:18:34.266 MAObjCRuntime[4644:a0f] Testing TestSetSuperclass 2011-11-27 17:18:34.267 MAObjCRuntime[4644:a0f] TestSetSuperclass: SUCCESS 2011-11-27 17:18:34.268 MAObjCRuntime[4644:a0f] Testing TestInstanceSize 2011-11-27 17:18:34.268 MAObjCRuntime[4644:a0f] TestInstanceSize: SUCCESS 2011-11-27 17:18:34.269 MAObjCRuntime[4644:a0f] Testing TestSetClass 2011-11-27 17:18:34.270 MAObjCRuntime[4644:a0f] TestSetClass: SUCCESS 2011-11-27 17:18:34.270 MAObjCRuntime[4644:a0f] Testing TestMethodList 2011-11-27 17:18:34.271 MAObjCRuntime[4644:a0f] TestMethodList: SUCCESS 2011-11-27 17:18:34.272 MAObjCRuntime[4644:a0f] Testing TestAddMethod 2011-11-27 17:18:34.272 MAObjCRuntime[4644:a0f] TestAddMethod: SUCCESS 2011-11-27 17:18:34.273 MAObjCRuntime[4644:a0f] Testing TestMethodFetching 2011-11-27 17:18:34.275 MAObjCRuntime[4644:a0f] TestMethodFetching: SUCCESS 2011-11-27 17:18:34.275 MAObjCRuntime[4644:a0f] Testing TestSetMethod 2011-11-27 17:18:34.278 MAObjCRuntime[4644:a0f] TestSetMethod: SUCCESS 2011-11-27 17:18:34.279 MAObjCRuntime[4644:a0f] Testing TestProtocolQuery 2011-11-27 17:18:34.280 MAObjCRuntime[4644:a0f] TestProtocolQuery:189: assertion failed: [[protocol incorporatedProtocols] containsObject: [RTProtocol protocolWithObjCProtocol: NSProtocolFromString(@"NSObject")]] 2011-11-27 17:18:34.280 MAObjCRuntime[4644:a0f] TestProtocolQuery: FAILED 2011-11-27 17:18:34.281 MAObjCRuntime[4644:a0f] Testing TestIvarQuery 2011-11-27 17:18:34.282 MAObjCRuntime[4644:a0f] TestIvarQuery: SUCCESS 2011-11-27 17:18:34.286 MAObjCRuntime[4644:a0f] Testing TestPropertyQuery 2011-11-27 17:18:34.289 MAObjCRuntime[4644:a0f] TestPropertyQuery: SUCCESS 2011-11-27 17:18:34.290 MAObjCRuntime[4644:a0f] Testing TestIvarAdd 2011-11-27 17:18:34.291 MAObjCRuntime[4644:a0f] TestIvarAdd: SUCCESS 2011-11-27 17:18:34.292 MAObjCRuntime[4644:a0f] Testing TestEquality 2011-11-27 17:18:34.292 MAObjCRuntime[4644:a0f] TestEquality: SUCCESS 2011-11-27 17:18:34.293 MAObjCRuntime[4644:a0f] Testing TestMessageSending 2011-11-27 17:18:34.293 MAObjCRuntime[4644:a0f] TestMessageSending: SUCCESS 2011-11-27 17:18:34.294 MAObjCRuntime[4644:a0f] Testing TestMessageSendingNSObjectCategory 2011-11-27 17:18:34.297 MAObjCRuntime[4644:a0f] TestMessageSendingNSObjectCategory: SUCCESS 2011-11-27 17:18:34.298 MAObjCRuntime[4644:a0f] Tests complete: FAILED: 1 total assertion failure

The Xcode project in my fork make it easy to repro: just switch to the i386 executable.

mikeash commented 12 years ago

Thanks, and fixed. -[Protocol isEqual:] is busted. Fortunately there's a protocol_isEqual function that works.