Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/test_common.c
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/test_common.c
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/test_common.c')
-rw-r--r--tests/test_common.c7
1 files changed, 7 insertions, 0 deletions
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;
}