summaryrefslogtreecommitdiff
path: root/source4/torture/local/sddl.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-06-16 22:48:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:09 -0500
commit69270cfff6e9eaa527969ce805471b200cfbf7fb (patch)
tree2229b0a9b07559eb5d8765e85cb25e2c10ef82e2 /source4/torture/local/sddl.c
parent582d46ec42144bddccddacadd52a0256f58cb453 (diff)
downloadsamba-69270cfff6e9eaa527969ce805471b200cfbf7fb.tar.gz
samba-69270cfff6e9eaa527969ce805471b200cfbf7fb.tar.bz2
samba-69270cfff6e9eaa527969ce805471b200cfbf7fb.zip
r16315: Convert to new API.
(This used to be commit 0e52a831ed88b5d61033aee56a17e49b84df6773)
Diffstat (limited to 'source4/torture/local/sddl.c')
-rw-r--r--source4/torture/local/sddl.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source4/torture/local/sddl.c b/source4/torture/local/sddl.c
index 20526d7323..cb5919283f 100644
--- a/source4/torture/local/sddl.c
+++ b/source4/torture/local/sddl.c
@@ -24,17 +24,20 @@
#include "libcli/security/security.h"
#include "torture/torture.h"
#include "librpc/gen_ndr/ndr_security.h"
+#include "torture/ui.h"
/*
test one SDDL example
*/
-static BOOL test_sddl(TALLOC_CTX *mem_ctx, const char *sddl)
+static BOOL test_sddl(struct torture_context *mem_ctx, const void *_sddl)
{
struct security_descriptor *sd, *sd2;
struct dom_sid *domain;
+ const char *sddl = _sddl;
const char *sddl2;
+
domain = dom_sid_parse_talloc(mem_ctx, "S-1-2-3-4");
sd = sddl_decode(mem_ctx, sddl, domain);
if (sd == NULL) {
@@ -97,14 +100,14 @@ static const char *examples[] = {
/* test a set of example SDDL strings */
BOOL torture_local_sddl(struct torture_context *torture)
{
+ struct torture_suite *suite = torture_suite_create(torture, "LOCAL-SDDL");
int i;
- BOOL ret = True;
- TALLOC_CTX *mem_ctx = talloc_new(NULL);
- for (i=0;i<ARRAY_SIZE(examples);i++) {
- ret &= test_sddl(mem_ctx, examples[i]);
+ for (i = 0; i < ARRAY_SIZE(examples); i++) {
+ torture_suite_add_simple_tcase(suite,
+ talloc_asprintf(suite, "%d", i),
+ test_sddl, examples[i]);
}
- talloc_free(mem_ctx);
- return ret;
+ return torture_run_suite(torture, suite);
}