summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tests/cmocka/test_data_provider_be.c17
-rw-r--r--src/tests/cmocka/test_utils.c17
-rw-r--r--src/tests/common.h4
-rw-r--r--src/tests/common_dom.c22
4 files changed, 26 insertions, 34 deletions
diff --git a/src/tests/cmocka/test_data_provider_be.c b/src/tests/cmocka/test_data_provider_be.c
index 68eb5841b..52d65076c 100644
--- a/src/tests/cmocka/test_data_provider_be.c
+++ b/src/tests/cmocka/test_data_provider_be.c
@@ -66,23 +66,6 @@ struct test_ctx {
struct be_ctx *be_ctx;
};
-static 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);
- assert_non_null(dom);
-
- dom->name = talloc_strdup(dom, name);
- assert_non_null(dom->name);
-
- dom->parent = parent;
-
- return dom;
-}
-
static int test_setup(void **state)
{
struct test_ctx *test_ctx = NULL;
diff --git a/src/tests/cmocka/test_utils.c b/src/tests/cmocka/test_utils.c
index a22c39c47..cab168437 100644
--- a/src/tests/cmocka/test_utils.c
+++ b/src/tests/cmocka/test_utils.c
@@ -454,23 +454,6 @@ void test_find_domain_by_sid_disabled(void **state)
}
}
-static 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);
- assert_non_null(dom);
-
- dom->name = talloc_strdup(dom, name);
- assert_non_null(dom->name);
-
- dom->parent = parent;
-
- return dom;
-}
-
/*
* dom1 -> sub1a
* |
diff --git a/src/tests/common.h b/src/tests/common.h
index 1c6de2c3d..c0ceebfbf 100644
--- a/src/tests/common.h
+++ b/src/tests/common.h
@@ -134,4 +134,8 @@ test_dbus_call_sync(DBusConnection *conn,
int first_arg_type,
...);
+struct sss_domain_info *named_domain(TALLOC_CTX *mem_ctx,
+ const char *name,
+ struct sss_domain_info *parent);
+
#endif /* !__TESTS_COMMON_H__ */
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;
+}