lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Building automated test cases


From: Erik Ekman
Subject: Re: [lwip-users] Building automated test cases
Date: Sun, 30 Mar 2008 11:51:27 +0200

On 3/30/08, Frédéric BERNON <address@hidden> wrote:
> In all cases, adding some testing tools for lwip could be good, but I don't
>  know "check", but I'm afraid it give lot of "boring" code in the lwIP code.
>  Perhaps I'm wrong ? Next, to test the stack, I suppose you have to implement
>  a virtual device which simulate your input/output bytes arrays?
>
>  Can you give us a small sample of the "check" use with lwIP ?
>

I think it would be possible to do add all the tests without changing
any of the code in lwip/src directory. For testing the full stack, you
are right that a fake netif is needed, but for only testing smaller
parts of the stack it is not needed.

Having lots of small test cases gives greater confidence when doing
changes to the stack, it is easy to see that the stuff still works.

Check runs on *nix systems and also on cygwin, which I guess is good enough.

Testing of for instance netif/etharp.c could look like this:

Testing initialization
Testing clearing of old entries in arp table
Inserting an entry and testing locating it
Testing filling arp table
Testing updating arp table
Testing handling of incoming arp packets
Testing adding mac addresses to packets
Testing sending arp requests

The test code could be placed under lwip/test/netif/test_etharp.c for
instance, and would not bother anyone not interested in the tests. The
original etharp.c would remain unchanged.

/Erik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]