Subject: Re: Unit test suite for c-ares

Re: Unit test suite for c-ares

From: David Drysdale <drysdale_at_google.com>
Date: Thu, 22 Oct 2015 16:03:37 +0100

On Fri, Oct 9, 2015 at 2:56 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 9 Oct 2015, David Drysdale wrote:
>
>> I've made a start on a unit test suite for c-ares, and I'd be interested
>> in any feedback.
>
>
> In one word? AWESOME.

Thanks!

> I'm not a big C++ guy myself so I'm not overly thrilled with that choice,
> but I'm also much more *for* progress than letting my personal preference
> stand in the way and you're the driver here!
>
> As a project, c-ares will benefit greatly from a proper test suite.

By the way, I should observe that so far I've only seen one thing that
might count as a bug, even running with sanitizers/fuzzers etc -- so kudos
for the quality of the code!

That one thing is in this change:
  https://github.com/daviddrysdale/c-ares/commit/9e3b07236ade2
which polices the top 2 bits of a label length to be (only) 00 or 11
-- seem sensible?

More generally, what's the best way to proceed with these changes?
Given that test/
is independent, it seems like it would probably be OK for me to push
things in there
without getting a second opinion, but the things that affect the main
library itself should
have someone else take a look.

As well as the fix above, I think those things are (so far):
 - minor changes to align docs with the code:
  https://github.com/daviddrysdale/c-ares/commit/7601b73d76e00f
  https://github.com/daviddrysdale/c-ares/commit/708fe9df404dcc5
 - a change to allow repeated "-s searchdomain" options to ahost:
  https://github.com/daviddrysdale/c-ares/commit/bf04b967bddda7
 - changes to expose more internal functionality for the tests:
     - expose ares_library_initialized()
  https://github.com/daviddrysdale/c-ares/commit/a881731f4aefa60
     - allow malloc/free override:
  https://github.com/daviddrysdale/c-ares/commit/b017d2664283e0
 - convert README to README.md:
  https://github.com/daviddrysdale/c-ares/commit/af5d563ed1b138
 - extra options to configure:
  https://github.com/daviddrysdale/c-ares/commit/9d68aee0f3ceb9
  https://github.com/daviddrysdale/c-ares/commit/efa3f821753cc86
 - I assumed this should trigger a bump in the version number for next release:
  https://github.com/daviddrysdale/c-ares/commit/4a8754afdd6b80

> --
>
> / daniel.haxx.se
Received on 2015-10-22