1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r25004: Avoid talloc_autofree_context() when possible.

This commit is contained in:
Jelmer Vernooij 2007-09-07 16:27:57 +00:00 committed by Gerald (Jerry) Carter
parent 919b362009
commit 79669d28a3
7 changed files with 22 additions and 27 deletions

View File

@ -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);

View File

@ -43,15 +43,14 @@ 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");

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -282,10 +282,9 @@ 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(),
struct torture_suite *suite = torture_suite_create(mem_ctx,
"BENCH-WINS");
torture_suite_add_simple_test(suite, "wins", bench_wins);

View File

@ -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",