summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-16 23:32:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:55 -0500
commit48e07444e834f277665ac2010bd24b0fdc74194a (patch)
tree49bf879377545950ec8926557451a965ad6057e6 /source4/torture
parent4a03172e66694b51a24f7b5566f361c1f1767e29 (diff)
downloadsamba-48e07444e834f277665ac2010bd24b0fdc74194a.tar.gz
samba-48e07444e834f277665ac2010bd24b0fdc74194a.tar.bz2
samba-48e07444e834f277665ac2010bd24b0fdc74194a.zip
r4792: use type safety int the test suite too
(This used to be commit 4a963e3b7aa38f0f6907bcd8acaaeb8c7982cafa)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/composite.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index f1fb6a9829..080db4f2c2 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -28,7 +28,7 @@
static void loadfile_complete(struct smbcli_composite *c)
{
- int *count = c->async.private;
+ int *count = talloc_get_type(c->async.private, int);
(*count)++;
}
@@ -45,7 +45,8 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
char *data;
size_t len = random() % 100000;
const int num_ops = 50;
- int i, count=0;
+ int i;
+ int *count = talloc_zero(mem_ctx, int);
data = talloc_array(mem_ctx, uint8_t, len);
@@ -72,16 +73,16 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
for (i=0;i<num_ops;i++) {
c[i] = smb_composite_loadfile_send(cli->tree, &io2);
c[i]->async.fn = loadfile_complete;
- c[i]->async.private = &count;
+ c[i]->async.private = count;
}
printf("waiting for completion\n");
- while (count != num_ops) {
+ while (*count != num_ops) {
event_loop_once(cli->transport->socket->event.ctx);
- printf("count=%d\r", count);
+ printf("count=%d\r", *count);
fflush(stdout);
}
- printf("count=%d\n", count);
+ printf("count=%d\n", *count);
for (i=0;i<num_ops;i++) {
status = smb_composite_loadfile_recv(c[i], mem_ctx);