Piotr Caban (@piotr) commented about dlls/msvcrt/tests/string.c:
- errno = 0xdeadbeef;
- ret = _mbsncpy(buf, NULL, 1);
- ok(ret == NULL, "_mbsncpy returned %p, expected NULL\n", ret);
- ok(errno == EINVAL, "_mbsncpy returned %d\n", errno);
- memset(buf, 0xff, sizeof(buf));
- ret = _mbsncpy(NULL, mbstring, 0);
- ok(ret == NULL, "_mbsncpy returned %p, expected %p\n", ret, buf);
- memset(buf, 0xff, sizeof(buf));
- ret = _mbsncpy(buf, NULL, 0);
- ok(ret == buf, "_mbsncpy returned %p, expected %sp\n", ret, buf);
- memset(buf, 0xff, sizeof(buf));
- ret = _mbsncpy(buf, mbstring, 0);
- ok(ret == buf, "_mbsncpy returned %p, expected %p\n", ret, buf);
I think this test is redundant, I don't see what's the advantage of adding it after testing `_mbsncpy(buf, NULL, 0)` case.