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.
This commit is contained in:
Philippe Waroquiers 2017-10-28 15:02:11 +02:00
parent bf87528d10
commit 2f9cceafa3

View File

@ -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