C++: update API
Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
diff --git a/swig/cpp/tests/test_libyang.cpp b/swig/cpp/tests/test_libyang.cpp
index e0ce236..499c16d 100644
--- a/swig/cpp/tests/test_libyang.cpp
+++ b/swig/cpp/tests/test_libyang.cpp
@@ -292,7 +292,7 @@
}
}
-TEST(test_ly_ctx_parse_path)
+TEST(test_ly_ctx_parse_module_path)
{
const char *yang_folder = TESTS_DIR "/api/files";
const char *yin_file = TESTS_DIR "/api/files/a.yin";
@@ -304,11 +304,11 @@
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- auto module = ctx->parse_path(yin_file, LYS_IN_YIN);
+ auto module = ctx->parse_module_path(yin_file, LYS_IN_YIN);
ASSERT_NOTNULL(module);
ASSERT_STREQ(module_name1, module->name());
- module = ctx->parse_path(yang_file, LYS_IN_YANG);
+ module = ctx->parse_module_path(yang_file, LYS_IN_YANG);
ASSERT_NOTNULL(module);
ASSERT_STREQ(module_name2, module->name());
} catch( const std::exception& e ) {
@@ -317,7 +317,7 @@
}
}
-TEST(test_ly_ctx_parse_path_invalid)
+TEST(test_ly_ctx_parse_module_path_invalid)
{
const char *yang_folder = TESTS_DIR "/api/files";
@@ -325,7 +325,7 @@
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- auto module = ctx->parse_path("INVALID_YANG_FILE", LYS_IN_YANG);
+ auto module = ctx->parse_module_path("INVALID_YANG_FILE", LYS_IN_YANG);
throw std::logic_error("exception not thrown");
} catch( const std::logic_error& e ) {
ASSERT_FALSE(e.what());
@@ -348,7 +348,7 @@
try {
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- ctx->parse_path(yin_file, LYS_IN_YIN);
+ ctx->parse_module_path(yin_file, LYS_IN_YIN);
auto submodule = ctx->get_submodule(module_name, nullptr, sub_name, nullptr);
ASSERT_NOTNULL(submodule);
@@ -369,7 +369,7 @@
try {
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- ctx->parse_path(yin_file, LYS_IN_YIN);
+ ctx->parse_module_path(yin_file, LYS_IN_YIN);
auto root = ctx->parse_data_path(config_file, LYD_XML, LYD_OPT_CONFIG | LYD_OPT_STRICT);
ASSERT_NOTNULL(root);
@@ -396,11 +396,11 @@
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- ctx->parse_path(yang_file, LYS_IN_YANG);
+ ctx->parse_module_path(yang_file, LYS_IN_YANG);
auto set = ctx->find_path(schema_path1);
ASSERT_NOTNULL(set);
- ctx->parse_path(yin_file, LYS_IN_YIN);
+ ctx->parse_module_path(yin_file, LYS_IN_YIN);
set = ctx->find_path(schema_path2);
ASSERT_NOTNULL(set);
S_Set(new Set());
@@ -419,7 +419,7 @@
try {
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- ctx->parse_path(yin_file, LYS_IN_YIN);
+ ctx->parse_module_path(yin_file, LYS_IN_YIN);
auto root = ctx->parse_data_path(config_file, LYD_XML, LYD_OPT_CONFIG | LYD_OPT_STRICT);
ASSERT_NOTNULL(root);
diff --git a/swig/cpp/tests/test_tree_data.cpp b/swig/cpp/tests/test_tree_data.cpp
index 07130e3..0657b03 100644
--- a/swig/cpp/tests/test_tree_data.cpp
+++ b/swig/cpp/tests/test_tree_data.cpp
@@ -129,7 +129,7 @@
}\n\
";
-TEST(test_ly_ctx_parse_mem)
+TEST(test_ly_ctx_parse_data_mem)
{
const char *a_data_xml = "\
<x xmlns=\"urn:a\">\n\
@@ -142,9 +142,9 @@
try {
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- ctx->parse_path(yin_file, LYS_IN_YIN);
+ ctx->parse_module_path(yin_file, LYS_IN_YIN);
- auto root = ctx->parse_mem(a_data_xml, LYD_XML, LYD_OPT_NOSIBLINGS | LYD_OPT_STRICT);
+ auto root = ctx->parse_data_mem(a_data_xml, LYD_XML, LYD_OPT_NOSIBLINGS | LYD_OPT_STRICT);
ASSERT_NOTNULL(root);
ASSERT_STREQ("x", root->schema()->name());
} catch( const std::exception& e ) {
@@ -153,7 +153,7 @@
}
}
-TEST(test_ly_ctx_parse_fd)
+TEST(test_ly_ctx_parse_data_fd)
{
const char *yang_folder = TESTS_DIR "/api/files";
const char *yin_file = TESTS_DIR "/api/files/a.yin";
@@ -162,11 +162,11 @@
try {
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- ctx->parse_path(yin_file, LYS_IN_YIN);
+ ctx->parse_module_path(yin_file, LYS_IN_YIN);
FILE *f = fopen(config_file, "r");
auto fd = f->_fileno;
- auto root = ctx->parse_fd(fd, LYD_XML, LYD_OPT_NOSIBLINGS | LYD_OPT_STRICT);
+ auto root = ctx->parse_data_fd(fd, LYD_XML, LYD_OPT_NOSIBLINGS | LYD_OPT_STRICT);
ASSERT_NOTNULL(root);
ASSERT_STREQ("x", root->schema()->name());
fclose(f);
@@ -187,7 +187,7 @@
try {
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- auto module = ctx->parse_path(yin_file, LYS_IN_YIN);
+ auto module = ctx->parse_module_path(yin_file, LYS_IN_YIN);
ASSERT_NOTNULL(module);
ASSERT_STREQ(module_name, module->name());
diff --git a/swig/cpp/tests/test_tree_schema.cpp b/swig/cpp/tests/test_tree_schema.cpp
index e22f5be..fb0b788 100644
--- a/swig/cpp/tests/test_tree_schema.cpp
+++ b/swig/cpp/tests/test_tree_schema.cpp
@@ -388,11 +388,11 @@
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- auto module = ctx->parse_path(yin_file, LYS_IN_YIN);
+ auto module = ctx->parse_module_path(yin_file, LYS_IN_YIN);
ASSERT_NOTNULL(module);
ASSERT_STREQ("a", module->name());
- module = ctx->parse_path(yang_file, LYS_IN_YANG);
+ module = ctx->parse_module_path(yang_file, LYS_IN_YANG);
ASSERT_NOTNULL(module);
ASSERT_STREQ("b", module->name());
} catch (const std::exception& e) {
@@ -410,7 +410,7 @@
auto ctx = S_Context(new Context(yang_folder));
ASSERT_NOTNULL(ctx);
- auto module = ctx->parse_path(yin_file, LYS_IN_YANG);
+ auto module = ctx->parse_module_path(yin_file, LYS_IN_YANG);
throw std::logic_error("exception not thrown");
} catch( const std::logic_error& e ) {
ASSERT_FALSE(e.what());