diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2008-05-01 06:22:46 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2008-05-01 06:22:46 +0000 |
commit | 9aac16ba78434b2f4cbbdd9ea0264c45286d370f (patch) | |
tree | a154c828747a208f77de2e7276b2388b1df065b2 /tests | |
parent | 040ee370b721049c5e91dfdfccb3321cd5fa8921 (diff) |
ensure that filter_get_var() and filter_get_var() return non-NULL to enable parsing of config file with attribute mapping and filter settings and use base from config file
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@712 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_myldap.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/test_myldap.c b/tests/test_myldap.c index 1a1463b..137ee08 100644 --- a/tests/test_myldap.c +++ b/tests/test_myldap.c @@ -37,12 +37,14 @@ struct worker_args { int id; }; +static char *foo=""; + /* this is a simple way to get this into an executable, we should probably read a valid config instead */ const char **base_get_var(int UNUSED(map)) {return NULL;} int *scope_get_var(int UNUSED(map)) {return NULL;} -const char **filter_get_var(int UNUSED(map)) {return NULL;} -const char **attmap_get_var(int UNUSED(map),const char UNUSED(*name)) {return NULL;} +const char **filter_get_var(int UNUSED(map)) {return &foo;} +const char **attmap_get_var(int UNUSED(map),const char UNUSED(*name)) {return &foo;} /* the maxium number of results to print (all results are retrieved) */ #define MAXRESULTS 10 @@ -66,7 +68,7 @@ static void test_search(void) printf("test_myldap: test_search(): doing search...\n"); search=myldap_search(session,nslcd_cfg->ldc_base, LDAP_SCOPE_SUBTREE, - "(objectclass=posixaccount)", + "(objectclass=posixAccount)", attrs); assert(search!=NULL); /* go over results */ @@ -114,7 +116,7 @@ static void test_get(void) assert(session!=NULL); /* perform search */ printf("test_myldap: test_get(): doing search...\n"); - search1=myldap_search(session,"dc=test,dc=tld", + search1=myldap_search(session,nslcd_cfg->ldc_base, LDAP_SCOPE_SUBTREE, "(&(|(objectClass=posixGroup)(objectClass=groupOfUniqueNames))(cn=testgroup2))", attrs1); @@ -312,7 +314,7 @@ static void *worker(void *arg) /* perform search */ search=myldap_search(session,nslcd_cfg->ldc_base, LDAP_SCOPE_SUBTREE, - "(objectclass=posixaccount)", + "(objectclass=posixAccount)", attrs); assert(search!=NULL); /* go over results */ @@ -379,7 +381,7 @@ static void test_connections(void) printf("test_myldap: test_connections(): doing search...\n"); search=myldap_search(session,nslcd_cfg->ldc_base, LDAP_SCOPE_SUBTREE, - "(objectclass=posixaccount)", + "(objectclass=posixAccount)", attrs); assert(search==NULL); /* clean up */ |