45 for (pathv =
g.gl_pathv; *pathv !=
NULL; ++pathv) {
46 #define _UT_ASSERT(cond) \ 47 M0_ASSERT_INFO(cond, \ 52 *pathv, (err ?: ""), (expected ?: ""), g_buf) 60 err = strstr(err,
"] ");
82 const char *
start = input;
95 for (end =
start; !M0_IN(*end, (0,
'\n')); ++end)
97 while (isblank(*(end-1)) && end-1 >
start)
104 static const struct {
109 {
"# ordinary comment",
NULL },
110 {
"not a comment",
NULL },
111 {
" #= not at start of the line",
NULL },
112 {
"#= special comment\nanything",
"special comment" },
113 {
"###= \t text\t ",
"text" },
114 {
"#=no leading space",
"no leading space" },
122 if (samples[
i].result ==
NULL) {
138 char *confstr =
NULL;
146 if (sharp_out !=
NULL)
152 .
ts_name =
"conf-validation-ut",
M0_INTERNAL int m0_conf_ut_cache_init(void)
static void test_validation(void)
M0_INTERNAL int m0_file_read(const char *path, char **out)
#define M0_SRC_PATH(name)
struct m0_ut_suite conf_validation_ut
struct m0_conf_cache m0_conf_ut_cache
static void cache_load(struct m0_conf_cache *cache, const char *path, char **sharp_out)
M0_INTERNAL int m0_conf_ut_cache_fini(void)
char * m0_conf_validation_error(struct m0_conf_cache *cache, char *buf, size_t buflen)
M0_INTERNAL void m0_conf_ut_cache_from_file(struct m0_conf_cache *cache, const char *path)
static char * sharp_comment(const char *input)
static void test_sharp_comment(void)
static int start(struct m0_fom *fom)
static struct gen g[MAX_GEN]
static struct m0_addb2_source * s