From 6f848e74467a32e9515e5c24c95b28cb5201ff45 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 22 Dec 2007 20:38:11 +0000 Subject: limit printing of results in test to just 10 git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@520 ef36b2f9-881f-0410-afb5-c4e39611909c --- tests/test_myldap.c | 54 ++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) (limited to 'tests') diff --git a/tests/test_myldap.c b/tests/test_myldap.c index 79928d4..da88b0c 100644 --- a/tests/test_myldap.c +++ b/tests/test_myldap.c @@ -43,6 +43,9 @@ 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;} +/* the maxium number of results to print (all results are retrieved) */ +#define MAXRESULTS 10 + /* This is a very basic search test, it performs a test to get certain entries from the database. It currently just prints out the DNs for the entries. */ @@ -68,9 +71,9 @@ static void test_search(void) printf("test_search(): get results...\n"); for (i=0;(entry=myldap_get_entry(search))!=NULL;i++) { - if (i<10) + if (iid,myldap_get_dn(entry)); + if (iid,i,myldap_get_dn(entry)); + else if (i==MAXRESULTS) + printf("test_threads(): [worker %d] ...\n",args->id); } printf("test_threads(): [worker %d] DONE\n",args->id); /* clean up */ @@ -229,27 +244,16 @@ static void test_threads(void) { int i; struct worker_args args[NUM_THREADS]; - /* partially initialize logging */ - log_setdefaultloglevel(LOG_DEBUG); - /* start worker threads */ for (i=0;i