From: Philippe Waroquiers Date: Sat, 28 Oct 2017 13:02:11 +0000 (+0200) Subject: introduce a test for n-i-bz fix bug in strspn replacement X-Git-Tag: VALGRIND_3_14_0~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f9cceafa34e1df39ddc5fe431fdb5c3a984e402;p=thirdparty%2Fvalgrind.git introduce a test for n-i-bz fix bug in strspn replacement c1eace647ca4f670ef9bec0d0fe72cdd25a96394 fixed a bug in strspn replacement. Add a test to cover this fix. --- diff --git a/memcheck/tests/str_tester.c b/memcheck/tests/str_tester.c index 9f7790a915..8a49428c8d 100644 --- a/memcheck/tests/str_tester.c +++ b/memcheck/tests/str_tester.c @@ -710,6 +710,15 @@ test_strspn (void) check(strspn("abc", "qx") == 0, 3); /* None. */ check(strspn("", "ab") == 0, 4); /* Null string. */ check(strspn("abc", "") == 0, 5); /* Null search list. */ + { + unsigned char work4[4]; + work4[0] = 0xe2; + work4[1] = 0xe3; + work4[2] = 0xd9; + work4[3] = '\0'; + /* Check for signed/unsigned mixup */ + check(strspn((char*)work4, (char*)work4) == 3, 6); + } } static void