schema mount NEW initial schema mount code
diff --git a/tests/utests/CMakeLists.txt b/tests/utests/CMakeLists.txt
index f67de0e..fa8ebba 100644
--- a/tests/utests/CMakeLists.txt
+++ b/tests/utests/CMakeLists.txt
@@ -75,3 +75,4 @@
ly_add_utest(NAME metadata SOURCES extensions/test_metadata.c)
ly_add_utest(NAME nacm SOURCES extensions/test_nacm.c)
ly_add_utest(NAME yangdata SOURCES extensions/test_yangdata.c)
+ly_add_utest(NAME schema_mount SOURCES extensions/test_schema_mount.c)
diff --git a/tests/utests/extensions/test_schema_mount.c b/tests/utests/extensions/test_schema_mount.c
new file mode 100644
index 0000000..5209dd1
--- /dev/null
+++ b/tests/utests/extensions/test_schema_mount.c
@@ -0,0 +1,58 @@
+/*
+ * @file test_schema_mount.c
+ * @author: Tadeas Vintrlik <xvintr04@stud.fit.vutbr.cz>
+ * @brief unit tests for Schema Mount extension support
+ *
+ * Copyright (c) 2021 CESNET, z.s.p.o.
+ *
+ * This source code is licensed under BSD 3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://opensource.org/licenses/BSD-3-Clause
+ */
+#define _UTEST_MAIN_
+#include "utests.h"
+
+#include "libyang.h"
+
+static int
+setup(void **state)
+{
+ UTEST_SETUP;
+
+ assert_int_equal(LY_SUCCESS, ly_ctx_set_searchdir(UTEST_LYCTX, TESTS_DIR_MODULES_YANG));
+ assert_non_null(ly_ctx_load_module(UTEST_LYCTX, "ietf-yang-schema-mount", "2019-01-14", NULL));
+
+ return 0;
+}
+
+static void
+test_compile(void **state)
+{
+ struct lys_module *mod;
+ const char *data = "module test-parent {yang-version 1.1;namespace \"urn:test-parent\";"
+ "prefix \"tp\"; import ietf-yang-schema-mount {prefix yangmnt;} container root {"
+ "yangmnt:mount-point \"root\" {}}}";
+
+ assert_int_equal(LY_SUCCESS, lys_parse_mem(UTEST_LYCTX, data, LYS_IN_YANG, &mod));
+}
+
+static void
+test_parse_no_yanglib(void **state)
+{
+ struct ly_ctx *new;
+ const char *data = "<root/>";
+
+ assert_int_equal(LY_SUCCESS, ly_ctx_new(NULL, 0, &new));
+}
+
+int
+main(void)
+{
+ const struct CMUnitTest tests[] = {
+ UTEST(test_compile, setup),
+ };
+
+ return cmocka_run_group_tests(tests, NULL, NULL);
+}
diff --git a/tests/utests/schema/test_schema.h b/tests/utests/schema/test_schema.h
index b7588dc..905cbfb 100644
--- a/tests/utests/schema/test_schema.h
+++ b/tests/utests/schema/test_schema.h
@@ -23,7 +23,7 @@
#include "tests_config.h"
LY_ERR test_imp_clb(const char *UNUSED(mod_name), const char *UNUSED(mod_rev), const char *UNUSED(submod_name),
- const char *UNUSED(sub_rev), void *user_data, LYS_INFORMAT * format,
+ const char *UNUSED(sub_rev), void *user_data, LYS_INFORMAT *format,
const char **module_data, void (**free_module_data)(void *model_data, void *user_data));
#define TEST_YANG_MODULE_10(MOD_NAME, MOD_PREFIX, MOD_NS, CONTENT) \