diff options
author | Björn Baumbach <bb@sernet.de> | 2011-07-22 10:48:35 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-22 17:06:08 +0200 |
commit | 0986b0bed78c90c2b688cc9d98e5daa8c471cdc2 (patch) | |
tree | a12cea13275109e21b776f15971071a5652b10bd /source3/torture | |
parent | 48de32936389612240203d3d12016d8730aeb64c (diff) | |
download | samba-0986b0bed78c90c2b688cc9d98e5daa8c471cdc2.tar.gz |
s3-torture: introduce test_cli_read()
test_cli_read calls cli_read and returns success or failure
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/torture.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index c197de98cb6..aa24a180122 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -1905,6 +1905,28 @@ static bool run_locktest3(int dummy) return correct; } +static bool test_cli_read(struct cli_state *cli, uint16_t fnum, + char *buf, off_t offset, size_t size, + size_t *nread, size_t expect) +{ + NTSTATUS status; + size_t l_nread; + + status = cli_read(cli, fnum, buf, offset, size, &l_nread); + + if(!NT_STATUS_IS_OK(status)) { + return false; + } else if (l_nread != expect) { + return false; + } + + if (nread) { + *nread = l_nread; + } + + return true; +} + #define EXPECTED(ret, v) if ((ret) != (v)) { \ printf("** "); correct = False; \ } |