msvcrt/tests: Add acceptable error codes for W2K8+.

This commit is contained in:
Ge van Geldorp 2009-09-02 12:16:29 +02:00 committed by Alexandre Julliard
parent 4845dc36e4
commit d24a5a74b1
1 changed files with 6 additions and 5 deletions

View File

@ -670,27 +670,28 @@ static void test_strtol(void)
unsigned long ul;
/* errno is only set in case of error, so reset errno to EBADF to check for errno modification */
/* errno is modified on W2K8+ */
errno = EBADF;
l = strtol("-1234", &e, 0);
ok(l==-1234, "wrong value %ld\n", l);
ok(errno == EBADF, "wrong errno %d\n", errno);
ok(errno == EBADF || broken(errno == 0), "wrong errno %d\n", errno);
errno = EBADF;
ul = strtoul("1234", &e, 0);
ok(ul==1234, "wrong value %lu\n", ul);
ok(errno == EBADF, "wrong errno %d\n", errno);
ok(errno == EBADF || broken(errno == 0), "wrong errno %d\n", errno);
errno = EBADF;
l = strtol("2147483647L", &e, 0);
ok(l==2147483647, "wrong value %ld\n", l);
ok(errno == EBADF, "wrong errno %d\n", errno);
ok(errno == EBADF || broken(errno == 0), "wrong errno %d\n", errno);
errno = EBADF;
l = strtol("-2147483648L", &e, 0);
ok(l==-2147483647L - 1, "wrong value %ld\n", l);
ok(errno == EBADF, "wrong errno %d\n", errno);
ok(errno == EBADF || broken(errno == 0), "wrong errno %d\n", errno);
errno = EBADF;
ul = strtoul("4294967295UL", &e, 0);
ok(ul==4294967295ul, "wrong value %lu\n", ul);
ok(errno == EBADF, "wrong errno %d\n", errno);
ok(errno == EBADF || broken(errno == 0), "wrong errno %d\n", errno);
errno = 0;
l = strtol("9223372036854775807L", &e, 0);