Do you have any preferences or recommendations for a unit testing framework? Distributed network software isn't too hard - if you abstract out the socket stuff you're just dealing with packets being sent to a callback function - and if packets can be sent to it, then test data works fine too. It takes a bit longer to write the first lot of tests, but it's really important to have them - very good for verifying RFC compliance (e.g. the recent RIPng TTL isue) as well as finding bugs.

Does anyone know of a good C unit testing framework?


On Tue, Jun 18, 2013 at 9:09 PM, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Tue, Jun 18, 2013 at 08:48:41AM +1200, Sam Russell wrote:
> Is there a set of unit tests for BIRD somewhere? I don't know where I'd
> start building them, but I'm happy to do the legwork on the coding - unit
> testing will make it a lot easier to add new modules and guarantee the
> functionality of existing ones.

There is no systematic unit test framework, there are some tests
scattered in code (like filter/test.conf or 'ifdef TEST' code in
nest/rt-fib.c). Some simple (perhaps make based?) unit testing framework
could be useful, OTOH distributed network software is pretty hard to
test by unit testing (you could test consistency of some core data
structures, but testing standards compliance for e.g. OSPF is much
harder problem).

--
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAlHAI9wACgkQw1GB2RHercNFTwCcC8fZFjwjm5geyKoqXvVmGt5l
ob4An1QpHGUjnVteHavV3W0FrfB0d93k
=Z/UG
-----END PGP SIGNATURE-----