Commit d24a5a74 authored by Ge van Geldorp's avatar Ge van Geldorp Committed by Alexandre Julliard

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

parent 4845dc36
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment