summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-26 05:32:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:43 -0500
commit1f7fbaf4937405a654f4f2e63e35a43a1390eabc (patch)
tree808b40541619d1568c0380970c9218e51f515cb7 /source4/torture
parentea43c2a3ed82fe3cc0643b10054a9ea596167398 (diff)
downloadsamba-1f7fbaf4937405a654f4f2e63e35a43a1390eabc.tar.gz
samba-1f7fbaf4937405a654f4f2e63e35a43a1390eabc.tar.bz2
samba-1f7fbaf4937405a654f4f2e63e35a43a1390eabc.zip
r3235: try readx beyond 64k in RAW-READ
(This used to be commit e07c557eca19c0dc17473090bde45c27953aaf65)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/read.c23
1 files changed, 17 insertions, 6 deletions
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;