summaryrefslogtreecommitdiffstats
path: root/source4/torture/torture.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-10-16 23:09:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:14 -0500
commitb58deeea692fc28827e249f0fc4a9d39263a4095 (patch)
treeb4e7ddc76fd026977803d4d067dc307e7e9d48e7 /source4/torture/torture.c
parentc2d6fad69bc42c0d7c261282797ca8baf9e9aad2 (diff)
downloadsamba-b58deeea692fc28827e249f0fc4a9d39263a4095.tar.gz
samba-b58deeea692fc28827e249f0fc4a9d39263a4095.tar.xz
samba-b58deeea692fc28827e249f0fc4a9d39263a4095.zip
r19350: Properly list LOCAL-TALLOC under the "LOCAL" header.
Support directories for subcategories in tests. Several small other fixes. (This used to be commit bde00d97068d559b025ab131ff698a82430d14b3)
Diffstat (limited to 'source4/torture/torture.c')
-rw-r--r--source4/torture/torture.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index d5cb0511f7e..f83a7330c2e 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -33,42 +33,23 @@ _PUBLIC_ int torture_seed=0;
_PUBLIC_ int torture_numasync=100;
_PUBLIC_ bool torture_showall = false;
-struct torture_suite_list *torture_suites = NULL;
+struct torture_suite *torture_root = NULL;
-NTSTATUS torture_register_suite(struct torture_suite *suite)
+bool torture_register_suite(struct torture_suite *suite)
{
- struct torture_suite_list *p, *n;
+ if (!suite)
+ return true;
- if (!suite) {
- return NT_STATUS_OK;
- }
-
- n = talloc(talloc_autofree_context(), struct torture_suite_list);
- n->suite = suite;
-
- for (p = torture_suites; p; p = p->next) {
- if (strcmp(p->suite->name, suite->name) == 0) {
- /* Check for duplicates */
- DEBUG(0,("There already is a suite registered with the name %s!\n", suite->name));
- return NT_STATUS_OBJECT_NAME_COLLISION;
- }
-
- if (strcmp(p->suite->name, suite->name) < 0 &&
- (!p->next || strcmp(p->next->suite->name, suite->name) > 0)) {
- DLIST_ADD_AFTER(torture_suites, n, p);
- return NT_STATUS_OK;
- }
- }
-
- DLIST_ADD_END(torture_suites, n, struct torture_suite_list *);
-
- return NT_STATUS_OK;
+ return torture_suite_add_suite(torture_root, suite);
}
int torture_init(void)
{
init_module_fn static_init[] = STATIC_torture_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "torture");
+
+ torture_root = talloc_zero(talloc_autofree_context(),
+ struct torture_suite);
run_init_functions(static_init);
run_init_functions(shared_init);