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:
parent
919b362009
commit
79669d28a3
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user