From 1f7fbaf4937405a654f4f2e63e35a43a1390eabc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Oct 2004 05:32:57 +0000 Subject: r3235: try readx beyond 64k in RAW-READ (This used to be commit e07c557eca19c0dc17473090bde45c27953aaf65) --- source4/torture/raw/read.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'source4/torture/raw') diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c index afec805cd4..8fb2a5de59 100644 --- a/source4/torture/raw/read.c +++ b/source4/torture/raw/read.c @@ -22,16 +22,16 @@ #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ - printf("(%d) Incorrect status %s - should be %s\n", \ - __LINE__, nt_errstr(status), nt_errstr(correct)); \ + printf("(%s) Incorrect status %s - should be %s\n", \ + __location__, nt_errstr(status), nt_errstr(correct)); \ ret = False; \ goto done; \ }} while (0) #define CHECK_VALUE(v, correct) do { \ if ((v) != (correct)) { \ - printf("(%d) Incorrect value %s=%d - should be %d\n", \ - __LINE__, #v, v, correct); \ + printf("(%s) Incorrect value %s=%d - should be %d\n", \ + __location__, #v, v, correct); \ ret = False; \ goto done; \ }} while (0) @@ -454,8 +454,8 @@ static BOOL test_readx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("Trying large read\n"); io.readx.in.offset = 0; - io.readx.in.mincnt = ~0; - io.readx.in.maxcnt = ~0; + io.readx.in.mincnt = 0xFFFF; + io.readx.in.maxcnt = 0xFFFF; status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.readx.out.remaining, 0xFFFF); @@ -463,6 +463,17 @@ static BOOL test_readx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.readx.out.nread, io.readx.in.maxcnt); CHECK_BUFFER(buf, seed, io.readx.out.nread); + printf("Trying extra large read\n"); + io.readx.in.offset = 0; + io.readx.in.mincnt = 100; + io.readx.in.maxcnt = 80000; + status = smb_raw_read(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(io.readx.out.remaining, 0xFFFF); + CHECK_VALUE(io.readx.out.compaction_mode, 0); + CHECK_VALUE(io.readx.out.nread, 0); + CHECK_BUFFER(buf, seed, io.readx.out.nread); + printf("Trying mincnt > maxcnt\n"); memset(buf, 0, maxsize); io.readx.in.offset = 0; -- cgit