mem: Correct testcases
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 22 Oct 2014 11:56:52 +0000 (13:56 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 27 Oct 2014 05:43:15 +0000 (16:13 +1030)
commit2ab3ac5b30c1cc58c0846e05c5943c03e7111ad8
treea436d611951fd51411cfa2b12986db0be284fbad
parent992931f06cf25d24fe74b4c617753aef2de70426
mem: Correct testcases

Currently the 'mem' module testcases use test/run.c even though they don't
rely on access to the module internals.  They're also missing an include
of mem.c, which has the effect that on systems with a C library memmem()
implementaiton, only that is tested, not the (re-)implementation in the
mem module itself.  This corrects that by moving run.c to api.c/

Additionally, the memmem() testcases don't cover the case where the
"needle" appears multiple times in the "haystack".  This patch also adds
such a test.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/mem/test/api.c [new file with mode: 0644]
ccan/mem/test/run.c [deleted file]