Allow pointer-to-pointer comparisons
authorWincent Colaiuta <win@wincent.com>
Tue, 24 Jul 2007 17:49:05 +0000 (19:49 +0200)
committerWincent Colaiuta <win@wincent.com>
Tue, 24 Jul 2007 17:49:05 +0000 (19:49 +0200)
commit8210f41cfe29b34a9927a5fb12b305762d40de69
tree0e6898c7ea64f0dcf3af4039793790c76ee81ef5
parent1266032b3c0da0a869f49a47459992e1243fcf5c
Allow pointer-to-pointer comparisons

Found another case in which comparing nil to nil was leading to a failing
test; ultimately the +[NSValue WOTest_compare:] method was being called where
both objects were encoded with type "pointer-to-void".

This commit adds a special case for such comparisons: truly equal pointers are
considered to be NSOrderedSame; all others fall through to the default path
and an exception is raised.

This is a conservative approach because in reality the only kind of pointer
comparison which makes sense in practice is an equality test, not an ordering
test.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
NSValue+WOTest.m