yin parser CHANGE add support for max-elements element
diff --git a/tests/src/test_parser_yang.c b/tests/src/test_parser_yang.c
index f63acee..258cba7 100644
--- a/tests/src/test_parser_yang.c
+++ b/tests/src/test_parser_yang.c
@@ -2230,6 +2230,7 @@
     assert_int_equal(parse_type_enum_value_pos(&ctx, &data, YANG_POSITION, &val, &flags, NULL), LY_EVALID);
     logbuf_assert("Invalid value \"-0\" of \"position\". Line number 1.");
 
+    *state = NULL;
     ly_ctx_destroy(ctx.ctx, NULL);
 }