From f8b8d8ccd3841ba7768d80f9c4254ea8fc5b767f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 7 Jan 2008 22:34:46 -0600 Subject: r26690: torture: Move torture_context_init() to the ui.c, where all functions related to it are. (This used to be commit 5f6cc640758448df9c8ad4eba1ffa12ce0c3f732) --- source4/torture/ui.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source4/torture/ui.c') diff --git a/source4/torture/ui.c b/source4/torture/ui.c index 66722a4cae..a7025aac95 100644 --- a/source4/torture/ui.c +++ b/source4/torture/ui.c @@ -24,6 +24,23 @@ #include "lib/util/dlinklist.h" #include "param/param.h" #include "system/filesys.h" +#include "auth/credentials/credentials.h" +#include "lib/cmdline/popt_common.h" + +struct torture_context *torture_context_init(TALLOC_CTX *mem_ctx, + const struct torture_ui_ops *ui_ops) +{ + struct torture_context *torture = talloc_zero(mem_ctx, + struct torture_context); + torture->ui_ops = ui_ops; + torture->returncode = true; + torture->ev = cli_credentials_get_event_context(cmdline_credentials); + + if (ui_ops->init) + ui_ops->init(torture); + + return torture; +} /** create a temporary directory. -- cgit