diff options
Diffstat (limited to 'src/tests/common_dom.c')
-rw-r--r-- | src/tests/common_dom.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tests/common_dom.c b/src/tests/common_dom.c index 46ea0b782..24d1f5a8a 100644 --- a/src/tests/common_dom.c +++ b/src/tests/common_dom.c @@ -371,3 +371,25 @@ void test_dom_suite_cleanup(const char *tests_path, test_multidom_suite_cleanup(tests_path, cdb_file, domains); } + +struct sss_domain_info *named_domain(TALLOC_CTX *mem_ctx, + const char *name, + struct sss_domain_info *parent) +{ + struct sss_domain_info *dom = NULL; + + dom = talloc_zero(mem_ctx, struct sss_domain_info); + if (dom == NULL) { + return NULL; + } + + dom->name = talloc_strdup(dom, name); + if (dom->name == NULL) { + talloc_free(dom); + return NULL; + } + + dom->parent = parent; + + return dom; +} |