Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2011-03-25 14:30:46 +0100
committerArthur de Jong <arthur@arthurdejong.org>2011-03-25 14:30:46 +0100
commit72c4709eefbfac429eca3ed8fb66decd03ed098d (patch)
treea4fdb41fba9ba7af21955457cc6dc229b3e5e8fb /tests
parent1fb820314c4b6f720bfca5ce5bfbc32183e3c3af (diff)
implement a validnames option that can be used to fine-tune the test for valid user and group names using a regular expression
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1411 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/test_common.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 272ce04..f132208 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -73,7 +73,7 @@ test_getpeercred_SOURCES = test_getpeercred.c
test_getpeercred_LDADD = ../compat/libcompat.a
test_common_SOURCES = test_common.c
-test_common_LDADD = ../nslcd/log.o ../nslcd/common.o ../nslcd/cfg.o \
+test_common_LDADD = ../nslcd/log.o ../nslcd/common.o \
../nslcd/alias.o ../nslcd/ether.o ../nslcd/group.o \
../nslcd/host.o ../nslcd/netgroup.o ../nslcd/network.o \
../nslcd/passwd.o ../nslcd/protocol.o ../nslcd/rpc.o \
diff --git a/tests/test_common.c b/tests/test_common.c
index 092867b..ee96733 100644
--- a/tests/test_common.c
+++ b/tests/test_common.c
@@ -26,6 +26,11 @@
#include <assert.h>
#include "nslcd/common.h"
+#include "nslcd/cfg.h"
+
+/* we include nslcd/cfg.c here to use cfg_defaults() to set the default
+ regular expression used in test_isvalidname() */
+#include "nslcd/cfg.c"
static void test_isvalidname(void)
{
@@ -41,6 +46,8 @@ static void test_isvalidname(void)
/* the main program... */
int main(int UNUSED(argc),char UNUSED(*argv[]))
{
+ nslcd_cfg=(struct ldap_config *)malloc(sizeof(struct ldap_config));
+ cfg_defaults(nslcd_cfg);
test_isvalidname();
return 0;
}