Subject: Re: Proposal for unittests

Re: Proposal for unittests

From: Jakub Hrozek <jhrozek_at_redhat.com>
Date: Fri, 26 Apr 2013 10:36:31 +0200

On Fri, Apr 26, 2013 at 09:47:02AM +0200, Patrick Valsecchi wrote:
> Hi,
>
> In attachment, you'll find a small prototype of a unittest suite for
> c-ares. I didn't integrate it with the autotools stuff, since I
> don't know it (we use cmake). For the moment, it is only testing the
> ares_parse_txt_reply function.
>
> I've used the simplest C testing framework I've found (CuTest) and
> I've fixed it a bit to remove a few memory leaks that were detected
> by valgrind.
>
> What do you all think? Is the direction I'm taking OK with you?
>
> Thanks and CU

Hi Patrick,

I'm a big fan of unit tests but I must say I didn't use CuTest before.
Looks pretty slim and minimal which I guess is quite important for
multiplatform project such as c-ares.

Did you look at cmocka (fork of Google's cmockery) ?
http://cmocka.cryptomilk.org/

We use it in the SSSD mainly because the SSSD is a network facing deamon
and in these scenarios support for mock objects comes very handy in
order to simulate the networking traffic.
Received on 2013-04-26