From cf86f85b088be7c6ddb8d060e93a7f3040efe342 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 22 Apr 2003 07:30:38 +0000 Subject: Bail out early when we fail on the rw_torture test. Andrew Bartlett (This used to be commit 65855d2ce920053a43882919a6ae509bbd86e54b) --- source3/torture/torture.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/torture') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index e4af6e9fcf..f85569b2af 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -499,18 +499,21 @@ static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2) if (cli_write(c1, fnum1, 0, buf, 0, buf_size) != buf_size) { printf("write failed (%s)\n", cli_errstr(c1)); correct = False; + break; } if ((bytes_read = cli_read(c2, fnum2, buf_rd, 0, buf_size)) != buf_size) { printf("read failed (%s)\n", cli_errstr(c2)); printf("read %d, expected %d\n", bytes_read, buf_size); correct = False; + break; } if (memcmp(buf_rd, buf, buf_size) != 0) { printf("read/write compare failed\n"); correct = False; + break; } } @@ -547,8 +550,10 @@ static BOOL run_readwritetest(int dummy) test1 = rw_torture2(cli1, cli2); printf("Passed readwritetest v1: %s\n", BOOLSTR(test1)); - test2 = rw_torture2(cli1, cli1); - printf("Passed readwritetest v2: %s\n", BOOLSTR(test2)); + if (test1) { + test2 = rw_torture2(cli1, cli1); + printf("Passed readwritetest v2: %s\n", BOOLSTR(test2)); + } if (!torture_close_connection(cli1)) { test1 = False; -- cgit