cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: documenting unit tests for functions

From: Amr Shahin <amrnablus_at_gmail.com>
Date: Thu, 12 May 2011 10:11:09 +0300

i think it's better to document that the function is unit-tested in place,
since this will tell whoever is gonna modify it that there is a test
available for this function that will allow her to make sure she didn't
cause any regressions :)

*Amr*

On Wed, May 11, 2011 at 10:24 PM, Dan Fandrich <dan_at_coneharvesters.com>wrote:

> On Wed, May 11, 2011 at 06:46:06PM +0200, Daniel Stenberg wrote:
> > I think this is a good idea. I would however prefer it to be a more
> > compact more easily machine-parsed format, like perhaps:
> >
> > /*
> > * @unit-test: 1300
> > */
> >
> > ... without reference to exact line number since that is doomed to
> > change over time, and unit-tests should preferably be focused on a
> > single function in each test anyway.
> >
> > >I was wondering if it's best to add this to the .h file or the .c file
> >
> > I say the .c file since we might end up with tests even for static
> > functions that have no prototypes in .h files.
>
> The alternative which the current tests already do to a degree, is to make
> the tested functions keywords in the test13xx file.
>
> >>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-12