Socket Test Suite (is coming)

John M McIntosh johnmci at smalltalkconsulting.com
Sat Jun 10 19:41:00 UTC 2000


As soon as I get the test suite to work on Linux I'll ship it.

When I was building the macintosh Open Transport code an interesting
objective was given. You must mimic the behavior of the old MacTCP code.
Well how and how do you test that? Of course the code is only documentation
it's not if there is a specification around. Oh and make it work on 68K and
PPC and all versions of the Mac OS back till the pre-Jobs era when we had
the OS flavor of the month, that just screams for automation eh?

So to solve this problem and preserve my sanity I bit the bullet and spent
many many hours building SUnit test case(s). Once I ship them you'll see
they are rough but the important thing was that I can run them on an old VM
using macTCP and the new VM using OT and they agree! They also allowed me to
tinker somewhat with the Smalltalk Socket class and ensured that the
behavior was the same as the historical pattern, well almost nope 257.0.0.0
is NOT a valid IP address, previous version of the resolver code disagreed
on this point.

To the people that promote this as the way to go, yes I coded test cases
then wrote the C code. I agree this is great, many times I found I wrote
'perfect' C code then tripped over a failure cheerfully pointed out by the
test suite. Also a few problems with OT versions popped up when I ran the
suite across a zillion macintosh OSs. In retrospect attempting to prove that
the code would work across all these different macintosh environments would
have proved impossible without a test suite.

I am hoping here that this will lay the foundation for a test suite we can
all use to validate the behavior of the socket primitives across all the
platform implementations. Right now there are differences between how the
mac version behaves and the linux version works, these little gothas can
cause problems for application programmers. Of course this should also
expand to cover other important plugins that are platform dependent.

Oh one last little thing I managed to violate an XP tenet and shipped Dan a
version of code to fix a very interesting problem he discovered at the last
minute and he promptly shipped that code to you all. Then I ran the full
test suite and discovered to my horror my one line change caused dreadful
side effects if you do socket close;close;close  (Not that you do that in
production code). This of course prompted a fix which is in the update
stream, the VM on the server was fixed early early this morning, and I don't
think anyone got their hands on the broken one.
 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7  E94A EE69 2D21 46FC 3BE6
===========================================================================





More information about the Squeak-dev mailing list