Take into account the more correct behavior of recent Linux kernels.

This commit is contained in:
Alexandre Julliard 2005-03-24 19:05:02 +00:00
parent 77a19ed8e6
commit 37698099d9
1 changed files with 4 additions and 8 deletions

View File

@ -151,9 +151,8 @@ static void test_CreateNamedPipe(int pipemode)
} }
else else
ok(readden == sizeof(obuf), "peek3 got %ld bytes\n", readden); ok(readden == sizeof(obuf), "peek3 got %ld bytes\n", readden);
todo_wine { if (avail != sizeof(obuf)) /* older Linux kernels only return the first write here */
ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %ld bytes available\n", avail); ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %ld bytes available\n", avail);
}
pbuf = ibuf; pbuf = ibuf;
ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "pipe content 3a check\n"); ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "pipe content 3a check\n");
if (pipemode == PIPE_TYPE_BYTE) { if (pipemode == PIPE_TYPE_BYTE) {
@ -184,9 +183,8 @@ static void test_CreateNamedPipe(int pipemode)
} }
else else
ok(readden == sizeof(obuf), "peek4 got %ld bytes\n", readden); ok(readden == sizeof(obuf), "peek4 got %ld bytes\n", readden);
todo_wine { if (avail != sizeof(obuf)) /* older Linux kernels only return the first write here */
ok(avail == sizeof(obuf) + sizeof(obuf2), "peek4 got %ld bytes available\n", avail); ok(avail == sizeof(obuf) + sizeof(obuf2), "peek4 got %ld bytes available\n", avail);
}
pbuf = ibuf; pbuf = ibuf;
ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "pipe content 4a check\n"); ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "pipe content 4a check\n");
if (pipemode == PIPE_TYPE_BYTE) { if (pipemode == PIPE_TYPE_BYTE) {
@ -230,9 +228,8 @@ static void test_CreateNamedPipe(int pipemode)
ok(written == sizeof(obuf2), "write file len 3b\n"); ok(written == sizeof(obuf2), "write file len 3b\n");
ok(PeekNamedPipe(hFile, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek5\n"); ok(PeekNamedPipe(hFile, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek5\n");
ok(readden == sizeof(obuf), "peek5 got %ld bytes\n", readden); ok(readden == sizeof(obuf), "peek5 got %ld bytes\n", readden);
todo_wine { if (avail != sizeof(obuf)) /* older Linux kernels only return the first write here */
ok(avail == sizeof(obuf) + sizeof(obuf2), "peek5 got %ld bytes available\n", avail); ok(avail == sizeof(obuf) + sizeof(obuf2), "peek5 got %ld bytes available\n", avail);
}
pbuf = ibuf; pbuf = ibuf;
ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 5a check\n"); ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 5a check\n");
ok(ReadFile(hFile, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); ok(ReadFile(hFile, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n");
@ -262,9 +259,8 @@ static void test_CreateNamedPipe(int pipemode)
ok(written == sizeof(obuf2), "write file len 6b\n"); ok(written == sizeof(obuf2), "write file len 6b\n");
ok(PeekNamedPipe(hnp, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek6\n"); ok(PeekNamedPipe(hnp, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek6\n");
ok(readden == sizeof(obuf), "peek6 got %ld bytes\n", readden); ok(readden == sizeof(obuf), "peek6 got %ld bytes\n", readden);
todo_wine { if (avail != sizeof(obuf)) /* older Linux kernels only return the first write here */
ok(avail == sizeof(obuf) + sizeof(obuf2), "peek6b got %ld bytes available\n", avail); ok(avail == sizeof(obuf) + sizeof(obuf2), "peek6b got %ld bytes available\n", avail);
}
pbuf = ibuf; pbuf = ibuf;
ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 6a check\n"); ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 6a check\n");
ok(ReadFile(hnp, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n"); ok(ReadFile(hnp, ibuf, sizeof(ibuf), &readden, NULL), "ReadFile\n");