From: Olivier Matz Date: Fri, 30 Mar 2018 20:24:01 +0000 (+0200) Subject: enhance completion unit test X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=66c99616cea7950a31b138b58e456855597f2d8a;p=protos%2Flibecoli.git enhance completion unit test --- diff --git a/lib/ecoli_complete.c b/lib/ecoli_complete.c index 815b825..7ad846c 100644 --- a/lib/ecoli_complete.c +++ b/lib/ecoli_complete.c @@ -681,6 +681,18 @@ static int ec_comp_testcase(void) c != NULL && ec_comp_count(c, EC_COMP_ALL) == 2, "complete count should is not 2\n"); + f = open_memstream(&buf, &buflen); + if (f == NULL) + goto fail; + ec_comp_dump(f, NULL); + fclose(f); + f = NULL; + + testres |= EC_TEST_CHECK( + strstr(buf, "no completion"), "bad dump\n"); + free(buf); + buf = NULL; + f = open_memstream(&buf, &buflen); if (f == NULL) goto fail; @@ -688,8 +700,10 @@ static int ec_comp_testcase(void) fclose(f); f = NULL; - /* testres |= EC_TEST_CHECK( */ - /* strstr(buf, "no match"), "bad dump\n"); */ + testres |= EC_TEST_CHECK( + strstr(buf, "comp="), "bad dump\n"); + testres |= EC_TEST_CHECK( + strstr(buf, "comp="), "bad dump\n"); free(buf); buf = NULL;