Add checking with ASCII DAFSA in test-is-public-all.c

This commit is contained in:
Tim Rühsen 2016-11-05 17:34:05 +01:00
parent 3211a66f00
commit 70661c6807
1 changed files with 12 additions and 3 deletions

View File

@ -131,7 +131,7 @@ static void test_psl_entry(const psl_ctx_t *psl, const char *domain, int type)
static void test_psl(void) static void test_psl(void)
{ {
FILE *fp; FILE *fp;
psl_ctx_t *psl, *psl3; psl_ctx_t *psl, *psl3, *psl4;
const psl_ctx_t *psl2; const psl_ctx_t *psl2;
int type = 0; int type = 0;
char buf[256], *linep, *p; char buf[256], *linep, *p;
@ -147,6 +147,11 @@ static void test_psl(void)
failed++; failed++;
} }
if (!(psl4 = psl_load_file("psl_ascii.dafsa"))) {
fprintf(stderr, "Failed to load 'psl_ascii.dafsa'\n");
failed++;
}
if ((fp = fopen(PSL_FILE, "r"))) { if ((fp = fopen(PSL_FILE, "r"))) {
#ifdef HAVE_CLOCK_GETTIME #ifdef HAVE_CLOCK_GETTIME
clock_gettime(CLOCK_REALTIME, &ts1); clock_gettime(CLOCK_REALTIME, &ts1);
@ -182,6 +187,9 @@ static void test_psl(void)
if (psl3) if (psl3)
test_psl_entry(psl3, p, type); test_psl_entry(psl3, p, type);
if (psl4)
test_psl_entry(psl4, p, type);
} }
#ifdef HAVE_CLOCK_GETTIME #ifdef HAVE_CLOCK_GETTIME
@ -193,9 +201,10 @@ static void test_psl(void)
failed++; failed++;
} }
psl_free(psl); psl_free(psl4);
psl_free((psl_ctx_t *)psl2);
psl_free(psl3); psl_free(psl3);
psl_free((psl_ctx_t *)psl2);
psl_free(psl);
} }
int main(int argc, const char * const *argv) int main(int argc, const char * const *argv)