Remove unused overloads in Schema
Change-Id: I919c7175401c557a489b6f288f7f5517a77472d9
diff --git a/tests/ls_interpreter.cpp b/tests/ls_interpreter.cpp
index 4a60762..2ae0b7c 100644
--- a/tests/ls_interpreter.cpp
+++ b/tests/ls_interpreter.cpp
@@ -26,11 +26,9 @@
IMPLEMENT_CONST_MOCK1(leafTypeName);
IMPLEMENT_CONST_MOCK1(isModule);
IMPLEMENT_CONST_MOCK1(leafrefPath);
- MAKE_CONST_MOCK3(listHasKey, bool(const schemaPath_& location, const ModuleNodePair& node, const std::string& key), override);
- MAKE_CONST_MOCK2(listHasKey, bool(const schemaPath_& listPath, const std::string& key), override);
+ IMPLEMENT_CONST_MOCK2(listHasKey);
IMPLEMENT_CONST_MOCK1(leafIsKey);
- MAKE_CONST_MOCK2(listKeys, const std::set<std::string>(const schemaPath_& location, const ModuleNodePair& node), override);
- MAKE_CONST_MOCK1(listKeys, const std::set<std::string>(const schemaPath_& listPath), override);
+ IMPLEMENT_CONST_MOCK1(listKeys);
MAKE_CONST_MOCK1(nodeType, yang::NodeTypes(const std::string&), override);
MAKE_CONST_MOCK2(nodeType, yang::NodeTypes(const schemaPath_&, const ModuleNodePair&), override);
IMPLEMENT_CONST_MOCK1(status);
diff --git a/tests/yang.cpp b/tests/yang.cpp
index 71cb69d..e2ece6f 100644
--- a/tests/yang.cpp
+++ b/tests/yang.cpp
@@ -566,23 +566,27 @@
SECTION("_list")
{
- node.first = "example-schema";
- node.second = "_list";
+ path.m_nodes.push_back(schemaNode_{module_{"example-schema"}, list_{"_list"}});
SECTION("number")
- key = "number";
+ {
+ key = "number";
+ }
}
SECTION("twoKeyList")
{
- node.first = "example-schema";
- node.second = "twoKeyList";
+ path.m_nodes.push_back(schemaNode_{module_{"example-schema"}, list_{"twoKeyList"}});
SECTION("number")
- key = "number";
+ {
+ key = "number";
+ }
SECTION("name")
- key = "name";
+ {
+ key = "name";
+ }
}
- REQUIRE(ys.listHasKey(path, node, key));
+ REQUIRE(ys.listHasKey(path, key));
}
SECTION("listKeys")
{
@@ -590,19 +594,17 @@
SECTION("_list")
{
+ path.m_nodes.push_back(schemaNode_{module_{"example-schema"}, list_{"_list"}});
set = {"number"};
- node.first = "example-schema";
- node.second = "_list";
}
SECTION("twoKeyList")
{
+ path.m_nodes.push_back(schemaNode_{module_{"example-schema"}, list_{"twoKeyList"}});
set = {"number", "name"};
- node.first = "example-schema";
- node.second = "twoKeyList";
}
- REQUIRE(ys.listKeys(path, node) == set);
+ REQUIRE(ys.listKeys(path) == set);
}
SECTION("leafType")
{
@@ -1257,9 +1259,9 @@
SECTION("nodetype-specific methods called with different nodetypes")
{
path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("a")));
- node.second = "a2";
+ path.m_nodes.push_back(schemaNode_(container_("a2")));
- REQUIRE(!ys.listHasKey(path, node, "chacha"));
+ REQUIRE(!ys.listHasKey(path, "chacha"));
}
SECTION("nonexistent module")