summaryrefslogtreecommitdiff
path: root/tests/errors.c
blob: 1411d0e933542959c4a70bd04d6536d7a6c4c7cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "test.h"

#include <stdlib.h>
#include <string.h>

void test_errors(void) {
	char **listing = list_dir("errors", ".pom");
	if (!listing)
		return;
	for (size_t i = 0; listing[i]; i++) {
		const char *conf_path = listing[i];
		printf("Testing %s...\n",conf_path);
		pom_error *error;
		pom_conf *conf = pom_load_path(NULL, conf_path, &error);
		if (error) {
			free(error);
			continue;
		}
		test_fail("Parsing %s didn't produce an error but it should have.", conf_path);
		pom_conf_free(conf);
	}
	free_listing(listing);
//	pom_conf *conf = pom_load_path("../tests");
}