libfanout: stash next pointer

Stash next pointer for entry when iterating over a linked list in
the "obviously correct" fanout lib.

The next pointer is lost when freeing the entry item in a for loop...
A penny^H^H^H^H^Hpointer saved is a pointer earned, as my grandma used
to say.

Signed-off-by: Max Sikström <msikstrom@op5.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/test-runcmd: Make it build with new runcmd flags

Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/test-nsutils: Update to use the defined functions

Way back I intended to give these utils a common prefix, and the
prefix lived on in the tests but not in the commit that actually
introduced the commit. Bad, bad Andreas...

Signed-off-by: Andreas Ericsson <ae@op5.se>
Add lib/test-fanout.c

It's obvious that even obviously correct code sometimes has really
obvious bugs, so obviously we need some sort of testing to make
sure the obviously correct code does the obviously correct thing.

Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/test-kvvec: Add a test for kvvec_capacity

It was the last untested function of the kvvec library, so now we
have full coverage there. Neato.

Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/test-iobroker: Also test iobroker_is_registered()

We run the test on removal and addition, which means we now test
to make sure the iobroker handles internal state exactly as
intended.

Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/test-dkhash: Flesh out with more tests

The counter-functions, among other things.

Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/test-bitmap: Flesh out bitmap tests a bit

More precise tests for intersections and a lot more coverage, for
example. If bitmap_unset() and bitmap_clear() fail, the config
parsing will be severely fouled up.

Signed-off-by: Andreas Ericsson <ae@op5.se>