Commit b7a8eefb authored by Alexandre Julliard's avatar Alexandre Julliard

Authors: Francois Gouget <fgouget@free.fr>, With help from Enio Schutt Jr <enio.s.jr@operamail.com>

Skip the overlapped I/O tests on files on Win9x.
parent 1998beae
...@@ -609,6 +609,7 @@ void test_offset_in_overlapped_structure(void) ...@@ -609,6 +609,7 @@ void test_offset_in_overlapped_structure(void)
HANDLE hFile; HANDLE hFile;
OVERLAPPED ov; OVERLAPPED ov;
DWORD done; DWORD done;
BOOL rc;
BYTE buf[256], pattern[] = "TeSt"; BYTE buf[256], pattern[] = "TeSt";
UINT i; UINT i;
char temp_path[MAX_PATH], temp_fname[MAX_PATH]; char temp_path[MAX_PATH], temp_fname[MAX_PATH];
...@@ -628,19 +629,23 @@ void test_offset_in_overlapped_structure(void) ...@@ -628,19 +629,23 @@ void test_offset_in_overlapped_structure(void)
memset(&ov, 0, sizeof(ov)); memset(&ov, 0, sizeof(ov));
ov.Offset = PATTERN_OFFSET; ov.Offset = PATTERN_OFFSET;
ov.OffsetHigh = 0; ov.OffsetHigh = 0;
ok(WriteFile(hFile, pattern, sizeof(pattern), &done, &ov), "WriteFile error %ld", GetLastError()); rc=WriteFile(hFile, pattern, sizeof(pattern), &done, &ov);
ok(done == sizeof(pattern), "expected number of bytes written %lu", done); /* Win 9x does not support the overlapped I/O on files */
trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT)); if (rc || GetLastError()!=ERROR_INVALID_PARAMETER) {
ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (PATTERN_OFFSET + sizeof(pattern)), ok(rc, "WriteFile error %ld", GetLastError());
"expected file offset %d", PATTERN_OFFSET + sizeof(pattern)); ok(done == sizeof(pattern), "expected number of bytes written %lu", done);
trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT));
ov.Offset = sizeof(buf) * 2; ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (PATTERN_OFFSET + sizeof(pattern)),
ov.OffsetHigh = 0; "expected file offset %d", PATTERN_OFFSET + sizeof(pattern));
ok(WriteFile(hFile, pattern, sizeof(pattern), &done, &ov), "WriteFile error %ld", GetLastError());
ok(done == sizeof(pattern), "expected number of bytes written %lu", done); ov.Offset = sizeof(buf) * 2;
/*trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT));*/ ov.OffsetHigh = 0;
ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (sizeof(buf) * 2 + sizeof(pattern)), ok(WriteFile(hFile, pattern, sizeof(pattern), &done, &ov), "WriteFile error %ld", GetLastError());
"expected file offset %d", sizeof(buf) * 2 + sizeof(pattern)); ok(done == sizeof(pattern), "expected number of bytes written %lu", done);
/*trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT));*/
ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (sizeof(buf) * 2 + sizeof(pattern)),
"expected file offset %d", sizeof(buf) * 2 + sizeof(pattern));
}
CloseHandle(hFile); CloseHandle(hFile);
...@@ -653,12 +658,16 @@ void test_offset_in_overlapped_structure(void) ...@@ -653,12 +658,16 @@ void test_offset_in_overlapped_structure(void)
memset(&ov, 0, sizeof(ov)); memset(&ov, 0, sizeof(ov));
ov.Offset = PATTERN_OFFSET; ov.Offset = PATTERN_OFFSET;
ov.OffsetHigh = 0; ov.OffsetHigh = 0;
ok(ReadFile(hFile, buf, sizeof(pattern), &done, &ov), "ReadFile error %ld", GetLastError()); rc=ReadFile(hFile, buf, sizeof(pattern), &done, &ov);
ok(done == sizeof(pattern), "expected number of bytes read %lu", done); /* Win 9x does not support the overlapped I/O on files */
trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT)); if (rc || GetLastError()!=ERROR_INVALID_PARAMETER) {
ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (PATTERN_OFFSET + sizeof(pattern)), ok(rc, "ReadFile error %ld", GetLastError());
"expected file offset %d", PATTERN_OFFSET + sizeof(pattern)); ok(done == sizeof(pattern), "expected number of bytes read %lu", done);
ok(!memcmp(buf, pattern, sizeof(pattern)), "pattern match failed"); trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT));
ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (PATTERN_OFFSET + sizeof(pattern)),
"expected file offset %d", PATTERN_OFFSET + sizeof(pattern));
ok(!memcmp(buf, pattern, sizeof(pattern)), "pattern match failed");
}
CloseHandle(hFile); CloseHandle(hFile);
......
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