summaryrefslogtreecommitdiff
path: root/source4/torture/ui.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-28 14:42:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:02 -0500
commit0e6773525fa9d3fe9b7559ab4067e088f8a934d8 (patch)
treefb9498c93995015771ba6dfd27ffcaa655f698a9 /source4/torture/ui.c
parent8277256cee6328a130e3a714579a4bc766d66b9b (diff)
downloadsamba-0e6773525fa9d3fe9b7559ab4067e088f8a934d8.tar.gz
samba-0e6773525fa9d3fe9b7559ab4067e088f8a934d8.tar.bz2
samba-0e6773525fa9d3fe9b7559ab4067e088f8a934d8.zip
r24741: More use of the torture API.
(This used to be commit de05c3651a6e9e6611b296873526afd9292327c1)
Diffstat (limited to 'source4/torture/ui.c')
-rw-r--r--source4/torture/ui.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/source4/torture/ui.c b/source4/torture/ui.c
index 23e761e5dc..92e03fff19 100644
--- a/source4/torture/ui.c
+++ b/source4/torture/ui.c
@@ -120,11 +120,11 @@ struct torture_test *torture_tcase_add_test(struct torture_tcase *tcase,
return test;
}
-struct torture_tcase *torture_suite_add_tcase(struct torture_suite *suite,
- const char *name)
-{
- struct torture_tcase *tcase = talloc(suite, struct torture_tcase);
+bool torture_suite_init_tcase(struct torture_suite *suite,
+ struct torture_tcase *tcase,
+ const char *name)
+{
tcase->name = talloc_strdup(tcase, name);
tcase->description = NULL;
tcase->setup = NULL;
@@ -134,6 +134,18 @@ struct torture_tcase *torture_suite_add_tcase(struct torture_suite *suite,
DLIST_ADD_END(suite->testcases, tcase, struct torture_tcase *);
+ return true;
+}
+
+
+struct torture_tcase *torture_suite_add_tcase(struct torture_suite *suite,
+ const char *name)
+{
+ struct torture_tcase *tcase = talloc(suite, struct torture_tcase);
+
+ if (!torture_suite_init_tcase(suite, tcase, name))
+ return NULL;
+
return tcase;
}
@@ -372,7 +384,7 @@ struct torture_tcase *torture_suite_add_simple_tcase(
test->run = wrap_test_with_simple_tcase;
test->fn = run;
test->data = data;
- test->dangerous = False;
+ test->dangerous = false;
DLIST_ADD_END(tcase->tests, test, struct torture_test *);
@@ -465,7 +477,7 @@ struct torture_test *torture_tcase_add_simple_test(
test->run = wrap_test_with_simple_test;
test->fn = run;
test->data = NULL;
- test->dangerous = False;
+ test->dangerous = false;
DLIST_ADD_END(tcase->tests, test, struct torture_test *);