From 920c1ca95c499194430a18a9f2186670c6861cc4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 17 Jun 2006 00:17:50 +0000 Subject: r16328: Wrap all existing tests in simple single-function testsuites. (This used to be commit 7e811adf59841936b7e634fca4e95630f890c5af) --- source4/torture/local/binding_string.c | 7 +++---- source4/torture/local/event.c | 8 +++----- source4/torture/local/idtree.c | 7 +++---- source4/torture/local/irpc.c | 7 +++---- source4/torture/local/messaging.c | 7 +++---- source4/torture/local/ndr.c | 7 +++---- source4/torture/local/registry.c | 7 +++---- source4/torture/local/resolve.c | 7 +++---- source4/torture/local/sddl.c | 7 +++---- source4/torture/local/socket.c | 8 +++----- source4/torture/local/util_file.c | 7 +++---- source4/torture/local/util_strlist.c | 7 +++---- 12 files changed, 36 insertions(+), 50 deletions(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/binding_string.c b/source4/torture/local/binding_string.c index a7b6cd14b4..3c38183ec9 100644 --- a/source4/torture/local/binding_string.c +++ b/source4/torture/local/binding_string.c @@ -24,7 +24,6 @@ #include "librpc/gen_ndr/epmapper.h" #include "librpc/rpc/dcerpc.h" #include "torture/torture.h" -#include "torture/ui.h" static BOOL test_BindingString(struct torture_context *torture, const void *_binding) @@ -111,10 +110,10 @@ static const char *test_strings[] = { "ncacn_unix_stream:[/tmp/epmapper,sign]", }; -BOOL torture_local_binding_string(struct torture_context *torture) +struct torture_suite *torture_local_binding_string(TALLOC_CTX *mem_ctx) { int i; - struct torture_suite *suite = torture_suite_create(torture, + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-BINDING"); for (i = 0; i < ARRAY_SIZE(test_strings); i++) { @@ -122,5 +121,5 @@ BOOL torture_local_binding_string(struct torture_context *torture) test_BindingString, test_strings[i]); } - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/event.c b/source4/torture/local/event.c index d886519220..f55cd8d466 100644 --- a/source4/torture/local/event.c +++ b/source4/torture/local/event.c @@ -24,7 +24,6 @@ #include "lib/events/events.h" #include "system/filesys.h" #include "torture/torture.h" -#include "torture/ui.h" const struct event_ops *event_standard_get_ops(void); const struct event_ops *event_liboop_get_ops(void); @@ -113,10 +112,9 @@ static BOOL test_event_context(struct torture_context *torture, const void *_dat return True; } -BOOL torture_local_event(struct torture_context *torture) +struct torture_suite *torture_local_event(TALLOC_CTX *mem_ctx) { - BOOL retv = True; - struct torture_suite *suite = torture_suite_create(torture, "LOCAL-EVENT"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-EVENT"); torture_suite_add_simple_tcase(suite, "standard with select", test_event_context, @@ -126,5 +124,5 @@ BOOL torture_local_event(struct torture_context *torture) test_event_context, (void *)True); - return retv; + return suite; } diff --git a/source4/torture/local/idtree.c b/source4/torture/local/idtree.c index a81eddedc3..1d317dbce3 100644 --- a/source4/torture/local/idtree.c +++ b/source4/torture/local/idtree.c @@ -22,7 +22,6 @@ #include "includes.h" #include "torture/torture.h" -#include "torture/ui.h" static BOOL torture_local_idtree_simple(struct torture_context *test, const void *_data) @@ -93,10 +92,10 @@ static BOOL torture_local_idtree_simple(struct torture_context *test, return True; } -BOOL torture_local_idtree(struct torture_context *torture) +struct torture_suite *torture_local_idtree(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, "LOCAL-IDTREE"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-IDTREE"); torture_suite_add_simple_tcase(suite, "idtree", torture_local_idtree_simple, NULL); - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/irpc.c b/source4/torture/local/irpc.c index b90f91d19b..219cf0bcdb 100644 --- a/source4/torture/local/irpc.c +++ b/source4/torture/local/irpc.c @@ -25,7 +25,6 @@ #include "lib/messaging/irpc.h" #include "librpc/gen_ndr/ndr_echo.h" #include "torture/torture.h" -#include "torture/ui.h" const uint32_t MSG_ID1 = 1, MSG_ID2 = 2; @@ -238,9 +237,9 @@ static BOOL irpc_setup(struct torture_context *test, void **_data) return True; } -BOOL torture_local_irpc(struct torture_context *torture) +struct torture_suite *torture_local_irpc(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, "LOCAL-IRPC"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-IRPC"); struct torture_tcase *tcase = torture_suite_add_tcase(suite, "irpc"); int i; uint32_t values[] = {0, 0x7FFFFFFE, 0xFFFFFFFE, 0xFFFFFFFF, @@ -255,5 +254,5 @@ BOOL torture_local_irpc(struct torture_context *torture) torture_tcase_add_test(tcase, "echodata", test_echodata, NULL); torture_tcase_add_test(tcase, "speed", test_speed, NULL); - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/messaging.c b/source4/torture/local/messaging.c index 38d3056f6e..8161c3ea4f 100644 --- a/source4/torture/local/messaging.c +++ b/source4/torture/local/messaging.c @@ -24,7 +24,6 @@ #include "lib/events/events.h" #include "lib/messaging/irpc.h" #include "torture/torture.h" -#include "torture/ui.h" static uint32_t msg_pong; @@ -145,9 +144,9 @@ static BOOL test_ping_speed(struct torture_context *torture, const void *_data) return True; } -BOOL torture_local_messaging(struct torture_context *torture) +struct torture_suite *torture_local_messaging(TALLOC_CTX *mem_ctx) { - struct torture_suite *s = torture_suite_create(torture, "LOCAL-MESSAGING"); + struct torture_suite *s = torture_suite_create(mem_ctx, "LOCAL-MESSAGING"); torture_suite_add_simple_tcase(s, "ping_speed", test_ping_speed, NULL); - return torture_run_suite(torture, s); + return s; } diff --git a/source4/torture/local/ndr.c b/source4/torture/local/ndr.c index 4f743b5229..a24c64746a 100644 --- a/source4/torture/local/ndr.c +++ b/source4/torture/local/ndr.c @@ -21,7 +21,6 @@ #include "includes.h" #include "torture/torture.h" -#include "torture/ui.h" #include "librpc/ndr/libndr.h" static BOOL test_check_string_terminator(struct torture_context *test, @@ -75,13 +74,13 @@ static BOOL test_check_string_terminator(struct torture_context *test, return True; } -BOOL torture_local_ndr(struct torture_context *torture) +struct torture_suite *torture_local_ndr(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, "LOCAL-NDR"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-NDR"); torture_suite_add_simple_tcase(suite, "string terminator", test_check_string_terminator, NULL); - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/registry.c b/source4/torture/local/registry.c index 4c8d773a44..0e72c11aeb 100644 --- a/source4/torture/local/registry.c +++ b/source4/torture/local/registry.c @@ -24,7 +24,6 @@ #include "lib/registry/registry.h" #include "lib/cmdline/popt_common.h" #include "torture/torture.h" -#include "torture/ui.h" const static struct test_backend_settings { const char *name; @@ -77,9 +76,9 @@ static BOOL test_hive(struct torture_context *ctx, const void *_backend) return True; } -BOOL torture_registry(struct torture_context *torture) +struct torture_suite *torture_registry(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-REGISTRY"); int i; @@ -89,5 +88,5 @@ BOOL torture_registry(struct torture_context *torture) torture_suite_add_simple_tcase(suite, backends[i].name, test_hive, &backends[i]); } - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/resolve.c b/source4/torture/local/resolve.c index da83b45341..a9878e88ee 100644 --- a/source4/torture/local/resolve.c +++ b/source4/torture/local/resolve.c @@ -24,7 +24,6 @@ #include "lib/events/events.h" #include "libcli/resolve/resolve.h" #include "torture/torture.h" -#include "torture/ui.h" static BOOL test_async_resolve(struct torture_context *test, const void *_data) { @@ -81,13 +80,13 @@ static BOOL test_sync_resolve(struct torture_context *test, const void *_data) } -BOOL torture_local_resolve(struct torture_context *torture) +struct torture_suite *torture_local_resolve(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-RESOLVE"); torture_suite_add_simple_tcase(suite, "async", test_async_resolve, NULL); torture_suite_add_simple_tcase(suite, "sync", test_sync_resolve, NULL); - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/sddl.c b/source4/torture/local/sddl.c index cb5919283f..2db1006380 100644 --- a/source4/torture/local/sddl.c +++ b/source4/torture/local/sddl.c @@ -24,7 +24,6 @@ #include "libcli/security/security.h" #include "torture/torture.h" #include "librpc/gen_ndr/ndr_security.h" -#include "torture/ui.h" /* @@ -98,9 +97,9 @@ static const char *examples[] = { }; /* test a set of example SDDL strings */ -BOOL torture_local_sddl(struct torture_context *torture) +struct torture_suite *torture_local_sddl(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, "LOCAL-SDDL"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-SDDL"); int i; for (i = 0; i < ARRAY_SIZE(examples); i++) { @@ -109,5 +108,5 @@ BOOL torture_local_sddl(struct torture_context *torture) test_sddl, examples[i]); } - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/socket.c b/source4/torture/local/socket.c index 47fb98f96c..67728ab69b 100644 --- a/source4/torture/local/socket.c +++ b/source4/torture/local/socket.c @@ -26,7 +26,6 @@ #include "system/network.h" #include "netif/netif.h" #include "torture/torture.h" -#include "torture/ui.h" /* basic testing of udp routines @@ -135,7 +134,6 @@ static BOOL test_tcp(struct torture_context *test, const void *data) size_t size = 100 + (random() % 100); DATA_BLOB blob, blob2; size_t sent, nread; - BOOL ret = True; struct event_context *ev = event_context_init(test); status = socket_create("ip", SOCKET_TYPE_STREAM, &sock1, 0); @@ -207,13 +205,13 @@ static BOOL test_tcp(struct torture_context *test, const void *data) return True; } -BOOL torture_local_socket(struct torture_context *torture) +struct torture_suite *torture_local_socket(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-SOCKET"); torture_suite_add_simple_tcase(suite, "udp", test_udp, NULL); torture_suite_add_simple_tcase(suite, "tcp", test_tcp, NULL); - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/util_file.c b/source4/torture/local/util_file.c index f6152fe4c0..c950e68c6e 100644 --- a/source4/torture/local/util_file.c +++ b/source4/torture/local/util_file.c @@ -23,7 +23,6 @@ #include "includes.h" #include "system/filesys.h" #include "torture/torture.h" -#include "torture/ui.h" #define TEST_FILENAME "utilfile.test" #define TEST_LINE1 "This is list line 1..." @@ -83,9 +82,9 @@ static BOOL test_afdgets(struct torture_context *test, const void *data) return True; } -BOOL torture_local_util_file(struct torture_context *torture) +struct torture_suite *torture_local_util_file(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, "util_file"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "util_file"); torture_suite_add_simple_tcase(suite, "file_load_save", test_file_load_save, NULL); @@ -93,5 +92,5 @@ BOOL torture_local_util_file(struct torture_context *torture) torture_suite_add_simple_tcase(suite, "afdgets", test_afdgets, NULL); - return torture_run_suite(torture, suite); + return suite; } diff --git a/source4/torture/local/util_strlist.c b/source4/torture/local/util_strlist.c index 5887c01c6a..29886df995 100644 --- a/source4/torture/local/util_strlist.c +++ b/source4/torture/local/util_strlist.c @@ -22,7 +22,6 @@ #include "includes.h" #include "torture/torture.h" -#include "torture/ui.h" static const char *test_lists_shell_strings[] = { "", @@ -67,9 +66,9 @@ static BOOL test_lists_shell(struct torture_context *test, const void *_data) return True; } -BOOL torture_local_util_strlist(struct torture_context *torture) +struct torture_suite *torture_local_util_strlist(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(torture, "util_strlist"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "util_strlist"); int i; for (i = 0; test_lists_shell_strings[i]; i++) { @@ -78,5 +77,5 @@ BOOL torture_local_util_strlist(struct torture_context *torture) &test_lists_shell_strings[i]); } - return torture_run_suite(torture, suite); + return suite; } -- cgit