diff --git a/src/testutil.c b/src/testutil.c new file mode 100644 index 0000000..1628901 --- /dev/null +++ b/src/testutil.c @@ -0,0 +1,36 @@ +#include +#include +#include + +#include "config.h" +#include "ldapauth.h" + +int main(int argc, char *argv[]) { + char buf[1024]; + oal_config_t *config; + + if (argc < 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + return 1; + } + + config = (oal_config_t *) calloc (1, sizeof (oal_config_t)); + + if (parse_config(config, argv[1]) != 0) { + fprintf(stderr, "config parser failed: %s\n", config->error); + return 1; + } + + if (check_config(config) != 0) { + fprintf(stderr, "config check failed: %s\n", config->error); + return 1; + } + + while (fgets(buf, sizeof(buf), stdin) != NULL) { + ; + } + + free(config); + + return 0; +}