On Sat, 5 Apr 2008, Hrvoje Niksic wrote:

This would mean we'd need to separate uses of read() and write() on normal files (which should continue to use the real calls, until we replace them with the file I/O abstractions), from uses of read(), write(), etc on sockets, which would be using our emulated versions.

Unless you're willing to spend a lot of time in careful design of these abstractions, I think this is a mistake.

Related:

In the curl project we took a simpler route: we have our own dumb test servers in the test suite to run tests against and we have single files that describe each test case: what the server should respond, what the protocol dump should look like, what output to expect, what return code, etc. Then we have a script that reads the test case description, fires up the correct server(s), verifies
all the ouputs (optionally using valgrind).

This system allows us to write unit-tests if we'd like to, but mostly so far we've focused to test it system-wide. It is hard enough for us!

Reply via email to