From 0986b0bed78c90c2b688cc9d98e5daa8c471cdc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Baumbach?= Date: Fri, 22 Jul 2011 10:48:35 +0200 Subject: [PATCH] s3-torture: introduce test_cli_read() test_cli_read calls cli_read and returns success or failure Signed-off-by: Stefan Metzmacher --- source3/torture/torture.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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; \ } -- 2.11.4.GIT