r16332: Fix two small bugs found by the buildfarm.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 17 Jun 2006 01:20:02 +0000 (01:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:09:11 +0000 (14:09 -0500)
(This used to be commit 3decb34bb607b83f72deaa4baca935f4f253e2f2)

source4/torture/local/util_strlist.c
source4/torture/ui.c

index 29886df995c883be83fb7bcd09925aac1990eb84..65f8bc914ab26be0ac242affc5cd25bdcb20ab6f 100644 (file)
@@ -68,7 +68,7 @@ static BOOL test_lists_shell(struct torture_context *test, const void *_data)
 
 struct torture_suite *torture_local_util_strlist(TALLOC_CTX *mem_ctx)
 {
-       struct torture_suite *suite = torture_suite_create(mem_ctx, "util_strlist");
+       struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-STRLIST");
        int i;
 
        for (i = 0; test_lists_shell_strings[i]; i++) {
index 1878058a72a0102dacd7ff468bb333a5ae375db0..aca6934c90a29a2b3d74bcd83bb94169e9a407ad 100644 (file)
@@ -137,6 +137,7 @@ BOOL torture_run_suite(struct torture_context *context,
 static BOOL internal_torture_run_test(struct torture_context *context, 
                                          struct torture_tcase *tcase,
                                          struct torture_test *test,
+                                         BOOL already_setup,
                                          const void *tcase_data)
 {
        BOOL ret;
@@ -148,7 +149,7 @@ static BOOL internal_torture_run_test(struct torture_context *context,
                return True;
        }
 
-       if (!tcase_data && tcase->setup && !tcase->setup(context, &data))
+       if (!already_setup && tcase->setup && !tcase->setup(context, &data))
                return False;
 
        context->active_tcase = tcase;
@@ -160,7 +161,7 @@ static BOOL internal_torture_run_test(struct torture_context *context,
        context->last_reason = NULL;
        context->last_result = TORTURE_OK;
 
-       ret = test->run(context, tcase->setup?data:tcase->data, test->data);
+       ret = test->run(context, !already_setup?data:tcase_data, test->data);
 
        if (context->ui_ops->test_result)
                context->ui_ops->test_result(context, context->last_result, 
@@ -179,7 +180,7 @@ static BOOL internal_torture_run_test(struct torture_context *context,
        context->active_test = NULL;
        context->active_tcase = NULL;
 
-       if (!tcase_data && tcase->teardown && !tcase->teardown(context, data))
+       if (!already_setup && tcase->teardown && !tcase->teardown(context, data))
                return False;
 
        return ret;
@@ -204,7 +205,8 @@ BOOL torture_run_tcase(struct torture_context *context,
 
        for (test = tcase->tests; test; test = test->next) {
                ret &= internal_torture_run_test(context, tcase, test, 
-                                                                       (tcase->setup?data:tcase->data));
+                               tcase->fixture_persistent,
+                               (tcase->setup?data:tcase->data));
        }
 
        if (tcase->fixture_persistent && tcase->teardown &&
@@ -224,7 +226,7 @@ BOOL torture_run_test(struct torture_context *context,
                                          struct torture_tcase *tcase,
                                          struct torture_test *test)
 {
-       return internal_torture_run_test(context, tcase, test, NULL);
+       return internal_torture_run_test(context, tcase, test, False, NULL);
 }
 
 const char *torture_setting(struct torture_context *test, const char *name,