summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-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;