diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-09-07 16:27:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:05:30 -0500 |
commit | ff83c689cbc3216cced4e71c6f2e5e4c1a62e987 (patch) | |
tree | 578abb60028c1917361a957a6455077b78806366 /source4/torture | |
parent | e7efc7a533fd19b61515db058f31490ac75e5a79 (diff) | |
download | samba-ff83c689cbc3216cced4e71c6f2e5e4c1a62e987.tar.gz samba-ff83c689cbc3216cced4e71c6f2e5e4c1a62e987.tar.bz2 samba-ff83c689cbc3216cced4e71c6f2e5e4c1a62e987.zip |
r25004: Avoid talloc_autofree_context() when possible.
(This used to be commit 79669d28a346c9ae4abc7308070b25e07fe57433)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/nbt/dgram.c | 4 | ||||
-rw-r--r-- | source4/torture/nbt/nbt.c | 19 | ||||
-rw-r--r-- | source4/torture/nbt/query.c | 5 | ||||
-rw-r--r-- | source4/torture/nbt/register.c | 4 | ||||
-rw-r--r-- | source4/torture/nbt/wins.c | 5 | ||||
-rw-r--r-- | source4/torture/nbt/winsbench.c | 7 | ||||
-rw-r--r-- | source4/torture/nbt/winsreplication.c | 5 |
7 files changed, 22 insertions, 27 deletions
diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c index ee97242de5..c5b009979e 100644 --- a/source4/torture/nbt/dgram.c +++ b/source4/torture/nbt/dgram.c @@ -340,9 +340,9 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) /* test nbt dgram operations */ -struct torture_suite *torture_nbt_dgram(void) +struct torture_suite *torture_nbt_dgram(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "DGRAM"); + struct torture_suite *suite = torture_suite_create(suite, "DGRAM"); torture_suite_add_simple_test(suite, "netlogon", nbt_test_netlogon); torture_suite_add_simple_test(suite, "netlogon2", nbt_test_netlogon2); diff --git a/source4/torture/nbt/nbt.c b/source4/torture/nbt/nbt.c index 5c941c60c9..2a3678ee75 100644 --- a/source4/torture/nbt/nbt.c +++ b/source4/torture/nbt/nbt.c @@ -29,7 +29,7 @@ bool torture_nbt_get_name(struct torture_context *tctx, const char **address) { make_nbt_name_server(name, strupper_talloc(tctx, - torture_setting_string(tctx, "host", NULL))); + torture_setting_string(tctx, "host", NULL))); /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, @@ -43,18 +43,17 @@ bool torture_nbt_get_name(struct torture_context *tctx, NTSTATUS torture_nbt_init(void) { struct torture_suite *suite = torture_suite_create( - talloc_autofree_context(), - "NBT"); + talloc_autofree_context(), "NBT"); /* nbt tests */ - torture_suite_add_suite(suite, torture_nbt_register()); - torture_suite_add_suite(suite, torture_nbt_wins()); - torture_suite_add_suite(suite, torture_nbt_dgram()); - torture_suite_add_suite(suite, torture_nbt_winsreplication()); - torture_suite_add_suite(suite, torture_bench_nbt()); - torture_suite_add_suite(suite, torture_bench_wins()); + torture_suite_add_suite(suite, torture_nbt_register(suite)); + torture_suite_add_suite(suite, torture_nbt_wins(suite)); + torture_suite_add_suite(suite, torture_nbt_dgram(suite)); + torture_suite_add_suite(suite, torture_nbt_winsreplication(suite)); + torture_suite_add_suite(suite, torture_bench_nbt(suite)); + torture_suite_add_suite(suite, torture_bench_wins(suite)); suite->description = talloc_strdup(suite, - "NetBIOS over TCP/IP and WINS tests"); + "NetBIOS over TCP/IP and WINS tests"); torture_register_suite(suite); diff --git a/source4/torture/nbt/query.c b/source4/torture/nbt/query.c index 5794d840ec..2f3a51a98c 100644 --- a/source4/torture/nbt/query.c +++ b/source4/torture/nbt/query.c @@ -104,10 +104,9 @@ static bool bench_namequery(struct torture_context *tctx) /* benchmark how fast a server can respond to name queries */ -struct torture_suite *torture_bench_nbt(void) +struct torture_suite *torture_bench_nbt(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), - "BENCH"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "BENCH"); torture_suite_add_simple_test(suite, "namequery", bench_namequery); return suite; diff --git a/source4/torture/nbt/register.c b/source4/torture/nbt/register.c index 03cc4e6cee..50c7cd3398 100644 --- a/source4/torture/nbt/register.c +++ b/source4/torture/nbt/register.c @@ -155,11 +155,11 @@ static bool nbt_refresh_own(struct torture_context *tctx) /* test name registration to a server */ -struct torture_suite *torture_nbt_register(void) +struct torture_suite *torture_nbt_register(TALLOC_CTX *mem_ctx) { struct torture_suite *suite; - suite = torture_suite_create(talloc_autofree_context(), "REGISTER"); + suite = torture_suite_create(mem_ctx, "REGISTER"); torture_suite_add_simple_test(suite, "register_own", nbt_register_own); torture_suite_add_simple_test(suite, "refresh_own", nbt_refresh_own); diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c index 7f3ed8e415..e2c51ab1a8 100644 --- a/source4/torture/nbt/wins.c +++ b/source4/torture/nbt/wins.c @@ -284,10 +284,9 @@ static bool nbt_test_wins(struct torture_context *tctx) /* test WINS operations */ -struct torture_suite *torture_nbt_wins(void) +struct torture_suite *torture_nbt_wins(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), - "WINS"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "WINS"); torture_suite_add_simple_test(suite, "wins", nbt_test_wins); diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c index f06db648fc..27edd57206 100644 --- a/source4/torture/nbt/winsbench.c +++ b/source4/torture/nbt/winsbench.c @@ -282,11 +282,10 @@ static bool bench_wins(struct torture_context *tctx) benchmark how fast a WINS server can respond to a mixture of registration/refresh/release and name query requests */ -struct torture_suite *torture_bench_wins(void) +struct torture_suite *torture_bench_wins(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create( - talloc_autofree_context(), - "BENCH-WINS"); + struct torture_suite *suite = torture_suite_create(mem_ctx, + "BENCH-WINS"); torture_suite_add_simple_test(suite, "wins", bench_wins); diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 0d9e758647..69ef56231b 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9669,11 +9669,10 @@ static bool torture_nbt_winsreplication_owned(struct torture_context *tctx) /* test simple WINS replication operations */ -struct torture_suite *torture_nbt_winsreplication(void) +struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create( - talloc_autofree_context(), - "WINSREPLICATION"); + mem_ctx, "WINSREPLICATION"); struct torture_tcase *tcase; tcase = torture_suite_add_simple_test(suite, "assoc_ctx1", |