tests REFACTOR simplify using customizable input handler

avoid need for input handler initiation in every test function. Instead,
use combination of the setups and global variable.
diff --git a/tests/utests/schema/test_parser_yang.c b/tests/utests/schema/test_parser_yang.c
index f1ab8da..38e6e47 100644
--- a/tests/utests/schema/test_parser_yang.c
+++ b/tests/utests/schema/test_parser_yang.c
@@ -66,8 +66,9 @@
 
 struct lys_yang_parser_ctx *YCTX;
 
+struct ly_in in = {0};
+
 #define YCTX_INIT \
-    struct ly_in in = {0}; \
     in.line = 1; \
     YCTX->in = ∈ \
     LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, &in)
@@ -89,6 +90,11 @@
     YCTX->parsed_mod->mod->ctx = UTEST_LYCTX;
     YCTX->parsed_mod->mod->parsed = YCTX->parsed_mod;
 
+    /* initilize and use the global easily available and customizable input handler */
+    in.line = 1;
+    YCTX->in = ∈
+    LOG_LOCINIT(UTEST_LYCTX, NULL, NULL, NULL, &in);
+
     return 0;
 }
 
@@ -96,6 +102,8 @@
 teardown(void **state)
 {
     lys_module_free(YCTX->parsed_mod->mod, NULL);
+    LOG_LOCBACK(UTEST_LYCTX, 0, 0, 0, 1);
+
     free(YCTX);
     YCTX = NULL;
 
@@ -116,8 +124,6 @@
     size_t len, size;
     uint8_t prefix = 0;
 
-    YCTX_INIT;
-
     /* storing into buffer */
     in.current = "abcd";
     buf = NULL;
@@ -198,8 +204,6 @@
     char *word, *buf;
     size_t len;
 
-    YCTX_INIT;
-
     TEST_GET_ARGUMENT_SUCCESS(" // this is a text of / one * line */ comment\nargument;",
             YCTX, Y_STR_ARG, "argument;", 8, ";", 2);
     assert_null(buf);
@@ -227,8 +231,6 @@
     char *word, *buf;
     size_t len;
 
-    YCTX_INIT;
-
     /* missing argument */
     in.current = ";";
     assert_int_equal(LY_SUCCESS, get_argument(YCTX, Y_MAYBE_STR_ARG, NULL, &word, &buf, &len));
@@ -343,8 +345,6 @@
     char *word;
     size_t len;
 
-    YCTX_INIT;
-
     in.current = "\n// comment\n\tinput\t{";
     assert_int_equal(LY_SUCCESS, get_keyword(YCTX, &kw, &word, &len));
     assert_int_equal(LY_STMT_INPUT, kw);
@@ -477,8 +477,6 @@
     uint16_t flags = 0;
     uint32_t value = 0;
     struct lysp_ext_instance *ext = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     in.current = " 1invalid; ...";
@@ -594,8 +592,6 @@
     struct lys_glob_unres unres = {0};
     struct lys_yang_parser_ctx *ctx_p;
 
-    YCTX_INIT;
-
     mod = mod_renew(YCTX);
 
     /* missing mandatory substatements */
@@ -854,8 +850,6 @@
 {
     struct lysp_deviation *d = NULL;
 
-    YCTX_INIT;
-
     /* invalid cardinality */
 #define TEST_DUP(MEMBER, VALUE1, VALUE2) \
     TEST_DUP_GENERIC(" test {deviate not-supported;", MEMBER, VALUE1, VALUE2, parse_deviation, \
@@ -900,8 +894,6 @@
 {
     struct lysp_deviate *d = NULL;
 
-    YCTX_INIT;
-
     /* invalid cardinality */
 #define TEST_DUP(TYPE, MEMBER, VALUE1, VALUE2) \
     TEST_DUP_GENERIC(TYPE" {", MEMBER, VALUE1, VALUE2, parse_deviate, \
@@ -958,8 +950,6 @@
 test_container(void **state)
 {
     struct lysp_node_container *c = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1015,8 +1005,6 @@
 {
     struct lysp_node_leaf *l = NULL;
 
-    YCTX_INIT;
-
     /* invalid cardinality */
 #define TEST_DUP(MEMBER, VALUE1, VALUE2) \
     in.current = "l {" MEMBER" "VALUE1";"MEMBER" "VALUE2";} ..."; \
@@ -1064,8 +1052,6 @@
 test_leaflist(void **state)
 {
     struct lysp_node_leaflist *ll = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1132,8 +1118,6 @@
 test_list(void **state)
 {
     struct lysp_node_list *l = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1184,8 +1168,6 @@
 test_choice(void **state)
 {
     struct lysp_node_choice *ch = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1223,8 +1205,6 @@
 test_case(void **state)
 {
     struct lysp_node_case *cs = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1258,8 +1238,6 @@
 test_any(void **state, enum ly_stmt kw)
 {
     struct lysp_node_anydata *any = NULL;
-
-    YCTX_INIT;
     if (kw == LY_STMT_ANYDATA) {
         YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
     } else {
@@ -1307,8 +1285,6 @@
 test_grouping(void **state)
 {
     struct lysp_grp *grp = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1355,8 +1331,6 @@
 {
     struct lysp_action *rpcs = NULL;
     struct lysp_node_container *c = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1424,8 +1398,6 @@
 {
     struct lysp_notif *notifs = NULL;
     struct lysp_node_container *c = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1475,8 +1447,6 @@
 test_uses(void **state)
 {
     struct lysp_node_uses *u = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1505,8 +1475,6 @@
 test_augment(void **state)
 {
     struct lysp_augment *a = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1543,8 +1511,6 @@
 test_when(void **state)
 {
     struct lysp_when *w = NULL;
-
-    YCTX_INIT;
     YCTX->parsed_mod->version = 2; /* simulate YANG 1.1 */
 
     /* invalid cardinality */
@@ -1583,8 +1549,6 @@
     int64_t val = 0;
     uint16_t flags = 0;
 
-    YCTX_INIT;
-
     in.current = "-0;";
     assert_int_equal(parse_type_enum_value_pos(YCTX, LY_STMT_VALUE, &val, &flags, NULL), LY_SUCCESS);
     assert_int_equal(val, 0);