From 2a743814acac368dd09ea0e222e5dcd16b72af57 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 25 Apr 2008 15:38:10 +0000 Subject: have the binary look up the file name and only use the shell script wrapper to determine if LDAP server is available git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@697 ef36b2f9-881f-0410-afb5-c4e39611909c --- tests/test_myldap.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests/test_myldap.c') diff --git a/tests/test_myldap.c b/tests/test_myldap.c index c127b58..1e9f5da 100644 --- a/tests/test_myldap.c +++ b/tests/test_myldap.c @@ -391,8 +391,16 @@ static void test_connections(void) /* the main program... */ int main(int argc,char *argv[]) { - assert(argc==2); - cfg_init(argv[1]); + char *srcdir; + char fname[100]; + /* build the name of the file */ + srcdir=getenv("srcdir"); + if (srcdir==NULL) + srcdir="."; + snprintf(fname,sizeof(fname),"%s/nss-ldapd-test.conf",srcdir); + fname[sizeof(fname)-1]='\0'; + /* initialize configuration */ + cfg_init(fname); /* partially initialize logging */ log_setdefaultloglevel(LOG_DEBUG); test_search(); -- cgit v1.2.3