Bail out early when we fail on the rw_torture test.
authorAndrew Bartlett <abartlet@samba.org>
Tue, 22 Apr 2003 07:30:38 +0000 (07:30 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Apr 2003 07:30:38 +0000 (07:30 +0000)
Andrew Bartlett

source/torture/torture.c

index e4af6e9fcf737ad120cbf38d12ae3bd828fd5616..f85569b2afe70b738e95f078702dd2ee5bfe63fb 100644 (file)
@@ -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;