From 2206df6b30c4992daa17257287390421cfc0662d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 23 Apr 2003 08:12:34 +0000 Subject: Merge torture tests from HEAD - it looks like we had rather an incomplete merge last time. I hope this might fix a few failures on the build farm too. Andrew Bartlett (This used to be commit 0c837126923cc30fa60223a5a68d4f527971cc7b) --- source3/torture/denytest.c | 54 +++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'source3/torture/denytest.c') diff --git a/source3/torture/denytest.c b/source3/torture/denytest.c index 017bb1c06d..3a7906fb33 100644 --- a/source3/torture/denytest.c +++ b/source3/torture/denytest.c @@ -1408,7 +1408,7 @@ static void progress_bar(unsigned i, unsigned total) */ BOOL torture_denytest1(int dummy) { - static struct cli_state cli1; + struct cli_state *cli1; int fnum1, fnum2; int i; BOOL correct = True; @@ -1421,10 +1421,10 @@ BOOL torture_denytest1(int dummy) printf("starting denytest1\n"); for (i=0;i<2;i++) { - cli_unlink(&cli1, fnames[i]); - fnum1 = cli_open(&cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE); - cli_write(&cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i])); - cli_close(&cli1, fnum1); + cli_unlink(cli1, fnames[i]); + fnum1 = cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE); + cli_write(cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i])); + cli_close(cli1, fnum1); } printf("testing %d entries\n", ARRAY_SIZE(denytable1)); @@ -1435,10 +1435,10 @@ BOOL torture_denytest1(int dummy) progress_bar(i, ARRAY_SIZE(denytable1)); - fnum1 = cli_open(&cli1, fname, + fnum1 = cli_open(cli1, fname, denytable1[i].mode1, denytable1[i].deny1); - fnum2 = cli_open(&cli1, fname, + fnum2 = cli_open(cli1, fname, denytable1[i].mode2, denytable1[i].deny2); @@ -1449,10 +1449,10 @@ BOOL torture_denytest1(int dummy) } else { char x = 1; res = A_0; - if (cli_read(&cli1, fnum2, (void *)&x, 0, 1) == 1) { + if (cli_read(cli1, fnum2, (void *)&x, 0, 1) == 1) { res += A_R; } - if (cli_write(&cli1, fnum2, 0, (void *)&x, 0, 1) == 1) { + if (cli_write(cli1, fnum2, 0, (void *)&x, 0, 1) == 1) { res += A_W; } } @@ -1472,15 +1472,15 @@ BOOL torture_denytest1(int dummy) resultstr(denytable1[i].result)); } - cli_close(&cli1, fnum1); - cli_close(&cli1, fnum2); + cli_close(cli1, fnum1); + cli_close(cli1, fnum2); } for (i=0;i<2;i++) { - cli_unlink(&cli1, fnames[i]); + cli_unlink(cli1, fnames[i]); } - if (!torture_close_connection(&cli1)) { + if (!torture_close_connection(cli1)) { correct = False; } @@ -1494,7 +1494,7 @@ BOOL torture_denytest1(int dummy) */ BOOL torture_denytest2(int dummy) { - static struct cli_state cli1, cli2; + static struct cli_state *cli1, *cli2; int fnum1, fnum2; int i; BOOL correct = True; @@ -1507,10 +1507,10 @@ BOOL torture_denytest2(int dummy) printf("starting denytest2\n"); for (i=0;i<2;i++) { - cli_unlink(&cli1, fnames[i]); - fnum1 = cli_open(&cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE); - cli_write(&cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i])); - cli_close(&cli1, fnum1); + cli_unlink(cli1, fnames[i]); + fnum1 = cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE); + cli_write(cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i])); + cli_close(cli1, fnum1); } for (i=0; i