summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-06-28 18:12:15 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-07-07 10:29:42 +0200
commit393306307bd908fcec8858f665226ac56238a21b (patch)
tree6f7cfa017cef1c9bdcd04019d8d1c9afa0f320a1 /src/tests
parent1f5f330f02a95abf76b46f42ce853d2a5a1f2a61 (diff)
downloadsssd-393306307bd908fcec8858f665226ac56238a21b.tar.gz
sssd-393306307bd908fcec8858f665226ac56238a21b.tar.xz
sssd-393306307bd908fcec8858f665226ac56238a21b.zip
UTIL: Remove unused functions
The conversion to sysdb made several functions obsolete. Remove them. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/cmocka/test_fqnames.c50
-rw-r--r--src/tests/cmocka/test_utils.c45
2 files changed, 0 insertions, 95 deletions
diff --git a/src/tests/cmocka/test_fqnames.c b/src/tests/cmocka/test_fqnames.c
index 3932e9624..f4cdd80ef 100644
--- a/src/tests/cmocka/test_fqnames.c
+++ b/src/tests/cmocka/test_fqnames.c
@@ -337,9 +337,6 @@ void sss_parse_name_check(struct parse_name_test_ctx *test_ctx,
errno_t ret;
char *domain = NULL;
char *name = NULL;
- const char *domain_const = NULL;
- const char *name_const = NULL;
-
check_leaks_push(test_ctx);
ret = sss_parse_name(test_ctx, test_ctx->nctx, input_name,
@@ -359,23 +356,6 @@ void sss_parse_name_check(struct parse_name_test_ctx *test_ctx,
talloc_zfree(name);
talloc_zfree(domain);
- ret = sss_parse_name_const(test_ctx, test_ctx->nctx, input_name,
- &domain_const, &name_const);
- assert_int_equal(ret, exp_ret);
-
- if (exp_name) {
- assert_non_null(name_const);
- assert_string_equal(name_const, exp_name);
- }
-
- if (exp_domain) {
- assert_non_null(domain_const);
- assert_string_equal(domain_const, exp_domain);
- }
-
- talloc_free(discard_const(name_const));
- talloc_free(discard_const(domain_const));
-
assert_true(check_leaks_pop(test_ctx) == true);
}
@@ -390,9 +370,6 @@ void parse_name_plain(void **state)
ret = sss_parse_name(test_ctx, test_ctx->nctx, NAME,
NULL, NULL);
assert_int_equal(ret, EOK);
- ret = sss_parse_name_const(test_ctx, test_ctx->nctx, NAME,
- NULL, NULL);
- assert_int_equal(ret, EOK);
sss_parse_name_check(test_ctx, NAME, EOK, NAME, NULL);
sss_parse_name_check(test_ctx, SPECIALNAME, EOK, SPECIALNAME, NULL);
@@ -484,29 +461,6 @@ void sss_parse_name_fail(void **state)
sss_parse_name_check(test_ctx, NAME"\\", ERR_REGEX_NOMATCH, NULL, NULL);
}
-void test_sss_get_domain_name(void **state)
-{
- struct parse_name_test_ctx *test_ctx = talloc_get_type(*state,
- struct parse_name_test_ctx);
- struct {
- const char *input;
- struct sss_domain_info *domain;
- const char *expected;
- } data[] = {{"user", test_ctx->dom, "user"},
- {"user", test_ctx->subdom, "user@" SUBDOMNAME},
- {"user@" SUBDOMNAME, test_ctx->subdom, "user@" SUBDOMNAME},
- {NULL, NULL, NULL}};
- char *name;
- int i;
-
- for (i = 0; data[i].input != NULL; i++) {
- name = sss_get_domain_name(test_ctx, data[i].input, data[i].domain);
- assert_non_null(name);
- assert_string_equal(name, data[i].expected);
- talloc_free(name);
- }
-}
-
int main(int argc, const char *argv[])
{
poptContext pc;
@@ -547,10 +501,6 @@ int main(int argc, const char *argv[])
cmocka_unit_test_setup_teardown(sss_parse_name_fail,
parse_name_test_setup,
parse_name_test_teardown),
-
- cmocka_unit_test_setup_teardown(test_sss_get_domain_name,
- parse_name_test_setup,
- parse_name_test_teardown),
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
diff --git a/src/tests/cmocka/test_utils.c b/src/tests/cmocka/test_utils.c
index ef3e894aa..fd20990ce 100644
--- a/src/tests/cmocka/test_utils.c
+++ b/src/tests/cmocka/test_utils.c
@@ -1291,48 +1291,6 @@ void test_sss_write_krb5_conf_snippet(void **state)
}
-void test_fix_domain_in_name_list(void **state)
-{
- struct name_init_test_ctx *test_ctx;
-
- int ret;
- struct sss_domain_info *sd;
- struct sss_domain_info *dom;
- const char *in[] = { "abc@test.case.dom", "def@TEST.case.DOM", NULL};
- char **out = NULL;
-
- test_ctx = talloc_get_type(*state, struct name_init_test_ctx);
- assert_non_null(test_ctx);
-
- ret = confdb_get_domains(test_ctx->confdb, &dom);
- assert_int_equal(ret, EOK);
-
- ret = sss_names_init(dom, test_ctx->confdb, NULL, &dom->names);
- assert_int_equal(ret, EOK);
-
- sd = talloc_zero(test_ctx, struct sss_domain_info);
- assert_non_null(sd);
- sd->name = talloc_strdup(sd, "TesT.CasE.DoM");
- assert_non_null(sd->name);
- sd->names = dom->names;
- sd->fqnames = true;
- DLIST_ADD(dom->subdomains, sd);
- sd->parent = dom;
-
- ret = fix_domain_in_name_list(test_ctx, dom, discard_const(in), &out);
- assert_int_equal(ret, EOK);
- assert_non_null(out);
- assert_non_null(out[0]);
- assert_string_equal(out[0], "abc@TesT.CasE.DoM");
- assert_non_null(out[1]);
- assert_string_equal(out[1], "def@TesT.CasE.DoM");
- assert_null(out[2]);
-
- talloc_free(out);
- talloc_free(sd);
- talloc_free(dom);
-}
-
struct unique_file_test_ctx {
char *filename;
};
@@ -1778,9 +1736,6 @@ int main(int argc, const char *argv[])
setup_leak_tests,
teardown_leak_tests),
cmocka_unit_test(test_sss_write_krb5_conf_snippet),
- cmocka_unit_test_setup_teardown(test_fix_domain_in_name_list,
- confdb_test_setup,
- confdb_test_teardown),
cmocka_unit_test_setup_teardown(test_sss_unique_file,
unique_file_test_setup,
unique_file_test_teardown),