From ee5d0c1a67aea7d6dff41bf610303be50075f6ba Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Sat, 10 Jul 2021 16:27:02 -0400 Subject: [PATCH] input: in certain tests, check that the string passed to the function is at the end of the string --- test/input.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/input.c b/test/input.c index 88b6731..498eadd 100644 --- a/test/input.c +++ b/test/input.c @@ -41,6 +41,7 @@ TEST line_limit(void) { libscomm_reset(&in); ASSERT_EQ(libscomm_read(&in, &p, &l), LIBSCOMM_COMPLETE); + ASSERT_EQ(p, &s[LIBSCOMM_MAXBUF]); PASS(); } @@ -60,6 +61,8 @@ TEST single_arg_too_large(void) { libscomm_reset(&in); ASSERT_EQ(libscomm_read(&in, &p, &l), LIBSCOMM_OVERFLOW); + ASSERT_EQ(p, &s[sizeof s - 1]); + ASSERT_EQ(in.len, 0); /* state values are opaque. */ @@ -81,6 +84,7 @@ TEST arg_limit(void) { ASSERT_EQ(libscomm_read(&in, &p, &l), LIBSCOMM_COMPLETE); ASSERT_EQ(l.name, 0); ASSERT_EQ(l.len, LIBSCOMM_MAXARG); + ASSERT_EQ(p, &s[sizeof s - 1]); for (i = 1; i <= l.len; i++) { sprintf(tbuf, " %d", i); @@ -98,6 +102,7 @@ TEST too_many_arg(void) { libscomm_reset(&in); ASSERT_EQ(libscomm_read(&in, &p, &l), LIBSCOMM_ARG_OVERFLOW); + ASSERT_EQ(p, &s[sizeof s - 1]); PASS(); }