tests CHANGE more leaf parsing/compilation checks according to RFC
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index 62aeb99..5fc25e1 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -2661,7 +2661,7 @@
DUP_STRING(ctx->ctx, leaf_p->dflt, leaf->dflt);
ret = lys_compile_type(ctx, node_p, node_p->flags, ctx->mod->parsed, node_p->name, &leaf_p->type, options, &leaf->type,
- leaf->units ? NULL : &leaf->units, leaf->dflt ? NULL : &leaf->dflt);
+ leaf->units ? NULL : &leaf->units, leaf->dflt || (leaf->flags & LYS_MAND_TRUE) ? NULL : &leaf->dflt);
LY_CHECK_GOTO(ret, done);
if (leaf->type->basetype == LY_TYPE_LEAFREF) {
/* store to validate the path in the current context at the end of schema compiling when all the nodes are present */
@@ -2679,6 +2679,8 @@
return LY_EVALID;
}
+ /* TODO validate default value according to the type, possibly postpone the check when the leafref target is known */
+
done:
return ret;
}