Convert WOTest class to use Objective-C 2.0 properties
This commit converts most of the accessors for the instance variables in the
WOTest class to Objective-C 2.0 properties.
At the same time some unused instance variables were disposed of or marked for
future deprecation.
Note that due to an apparent bug in the compiler I was unable to implement the
public-readonly/private-readwrite pattern as suggested in the documentation,
and so the readonly/readwrite portions are commented out. I will be making a
reduced test case for this and filing a Radar. Watch for a future commit that
adds the Radar number in a comment.
Previouly when growlnotify was not installed env would issue an ugly error
message to the standard error.
This commit redirects standard error to /dev/null so as to suppress this
output and instead checks the exit status of the env tool. When growlnotify
cannot be found in the current PATH a note (not an error or warning) is
printed to the console. Other failure cases issue either an error or a
warning, depending on their severity.
The handling of unrecognized selectors appears to have changed in Leopard in
ways that cause one of the mock object tests to fail. Specifically, an
NSInvalidArgumentException is raised and it appears that the -[NSProxy
doesNotRecognizeSelector:] method is being called; setting breakpoints
indicates that the -forward:: method on the WOMock class is no longer being
invoked.
So I am temporarily gating off this test so that we can get error-free test
runs, pending further investigation. I plan to rework much of the mock/stub
API in any case based on better understanding obtained through my experiences
with RSpec (my use of the terms "mock" and "stub" is incorrect, based on my
first contact with those terms in the OCMock framework); at a minimum, I plan
to rename WOStub and its subclasses to better reflect what it actually does
(it is a message recorder and should probably be called as such). I may also
later add WOMock subclasses that really are stubs (non-verifying mocks).
Remove unit test made redundant by garbage collection
One of the unit tests expected an exception to be raised when working with
objects that don't respond to the retain and release methods, but in a garbage
collected world these messages become no-ops (and in fact I believe that the
compiler literally optimizes them away to nothing).
As such, no exception was being raised and there is no way to "fix" either the
test or the tested implementation: it's simply that the test no longer makes
sense in the context of garbage collection. This commit removes the
now-redundant test.
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.
Leopard has a bug in the NSGetSizeAndAlignment() function which prevents it
from handling structs which have bitfields in them. This in turn breaks the
+[NSValue valueWithBytes:objCType:] method when used with structs containing
bitfields.
So this commit #ifdefs out the tests which fail as a result of this bug. A
simplified testcase demonstrating the problem has be en added to the "other"
subdirectory. A Radar has been filed (<rdar://problem/5357040>); currently
awaiting on a fix from Apple.
Extensive whitespace cleanup of entire codebase (over 9,300 lines in the diff)
cleaning up mixed tabs and spaces (now uses spaces consistently) and trailing
whitespace at the end of lines.
The behaviour of the @encode directive has changed on Leopard and this breaks
a number of the comparisons that previously worked in Tiger. For example,
comparisons between object pointers and nil, or even between nil and nil,
were broken.
This commit adds some special cases for these types of comparisons which
now perform simple pointer equality tests instead of failing. I also removed
one test which failed on Tiger (when nil was encoded as a numeric scalar) but
no longer fails on Leopard.
Now that this code is stored in a Git repository, remove the build-number embedding
procedure which got the SVK/Subversion revision number and embedded it in each
build.
To avoid possible missunderstandings caused by ambiguous interpretations of
dates (which might appear to be in either US or some kind of European format)
switch to more verbose, explicit dates.