Merge changes I52982071,I07091df4,Iba835038,I1e208001,Ib24c6652, ...

* changes:
  Remove unused exception
  Remove useless check in lyNodesToTree
  Remove unused constructor
  Add test for identityref invalid module
  Move all pretty printers to pretty_printers.hpp
  tests: Fix yang if-feature enum test
diff --git a/src/ast_path.cpp b/src/ast_path.cpp
index b913d0c..0079962 100644
--- a/src/ast_path.cpp
+++ b/src/ast_path.cpp
@@ -31,8 +31,6 @@
     return this->m_name == b.m_name && this->m_value == b.m_value;
 }
 
-leafList_::leafList_() = default;
-
 leafList_::leafList_(const std::string& name)
     : m_name(name)
 {
diff --git a/src/ast_path.hpp b/src/ast_path.hpp
index 9138946..da99a26 100644
--- a/src/ast_path.hpp
+++ b/src/ast_path.hpp
@@ -48,7 +48,6 @@
 };
 
 struct leafList_ {
-    leafList_();
     leafList_(const std::string& name);
 
     bool operator==(const leafList_& b) const;
diff --git a/src/libyang_utils.cpp b/src/libyang_utils.cpp
index 15b1b06..b4d584f 100644
--- a/src/libyang_utils.cpp
+++ b/src/libyang_utils.cpp
@@ -55,8 +55,6 @@
     };
 
     for (const auto& it : items) {
-        if (!it)
-            continue;
         if (it->schema()->nodetype() == LYS_CONTAINER) {
             if (libyang::Schema_Node_Container{it->schema()}.presence()) {
                 // The fact that the container is included in the data tree
diff --git a/src/parser.cpp b/src/parser.cpp
index 5efee6b..ce583ea 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -11,11 +11,9 @@
 #include "parser_context.hpp"
 #include "utils.hpp"
 
-TooManyArgumentsException::~TooManyArgumentsException() = default;
 
 InvalidCommandException::~InvalidCommandException() = default;
 
-
 Parser::Parser(const std::shared_ptr<const Schema> schema, const std::shared_ptr<const DataQuery> dataQuery)
     : m_schema(schema)
     , m_dataquery(dataQuery)
diff --git a/tests/data_query.cpp b/tests/data_query.cpp
index 5bc3222..5adc661 100644
--- a/tests/data_query.cpp
+++ b/tests/data_query.cpp
@@ -17,26 +17,10 @@
 #error "Unknown backend"
 #endif
 #include "data_query.hpp"
+#include "pretty_printers.hpp"
 #include "sysrepo_subscription.hpp"
 #include "utils.hpp"
 
-namespace std {
-std::ostream& operator<<(std::ostream& s, const std::vector<ListInstance> set)
-{
-    s << std::endl << "{" << std::endl;
-    std::transform(set.begin(), set.end(), std::experimental::make_ostream_joiner(s, ", \n"), [](const auto& map) {
-        std::ostringstream ss;
-        ss << "    {" << std::endl << "        ";
-        std::transform(map.begin(), map.end(), std::experimental::make_ostream_joiner(ss, ", \n        "), [](const auto& keyValue){
-            return "{" + keyValue.first + "{" + boost::core::demangle(keyValue.second.type().name()) + "}" + ", " + leafDataToString(keyValue.second) + "}";
-        });
-        ss << std::endl << "    }";
-        return ss.str();
-    });
-    s << std::endl << "}" << std::endl;
-    return s;
-}
-}
 
 TEST_CASE("data query")
 {
diff --git a/tests/keyvalue_completion.cpp b/tests/keyvalue_completion.cpp
index 61e90cd..b725dff2 100644
--- a/tests/keyvalue_completion.cpp
+++ b/tests/keyvalue_completion.cpp
@@ -11,17 +11,9 @@
 #include "ast_commands.hpp"
 #include "datastoreaccess_mock.hpp"
 #include "parser.hpp"
+#include "pretty_printers.hpp"
 #include "static_schema.hpp"
 
-namespace std {
-std::ostream& operator<<(std::ostream& s, const std::set<std::string> set)
-{
-    s << std::endl << "{";
-    std::copy(set.begin(), set.end(), std::experimental::make_ostream_joiner(s, ", "));
-    s << "}" << std::endl;
-    return s;
-}
-}
 
 TEST_CASE("keyvalue_completion")
 {
diff --git a/tests/leaf_editing.cpp b/tests/leaf_editing.cpp
index ca5c8d6..1a55fa1 100644
--- a/tests/leaf_editing.cpp
+++ b/tests/leaf_editing.cpp
@@ -11,14 +11,10 @@
 #include "ast_commands.hpp"
 #include "leaf_data_helpers.hpp"
 #include "parser.hpp"
+#include "pretty_printers.hpp"
 #include "static_schema.hpp"
 #include "utils.hpp"
 
-std::ostream& operator<<(std::ostream& s, const set_ cmd)
-{
-    return s << "Command SET {path: " << pathToSchemaString(cmd.m_path, Prefixes::Always) << ", type " << boost::core::demangle(cmd.m_data.type().name()) << ", data: " << leafDataToString(cmd.m_data) << "}";
-}
-
 TEST_CASE("leaf editing")
 {
     auto schema = std::make_shared<StaticSchema>();
@@ -572,6 +568,12 @@
             input = "set mod:foodIdentRef identityBLABLA";
         }
 
+        SECTION("identity with non-existing module")
+        {
+            expectedError = "Invalid module name";
+            input = "set mod:foodIdentRef xd:haha";
+        }
+
         SECTION("setting identities with wrong bases")
         {
             SECTION("set mod:foodIdentRef mod:vehicle")
diff --git a/tests/pretty_printers.hpp b/tests/pretty_printers.hpp
index 69c06f5..5b747a1 100644
--- a/tests/pretty_printers.hpp
+++ b/tests/pretty_printers.hpp
@@ -6,6 +6,7 @@
 */
 
 #include <experimental/iterator>
+#include <sstream>
 #include "parser.hpp"
 #include "utils.hpp"
 namespace std {
@@ -107,6 +108,29 @@
     return s;
 }
 
+std::ostream& operator<<(std::ostream& s, const std::set<std::string> set)
+{
+    s << std::endl << "{";
+    std::copy(set.begin(), set.end(), std::experimental::make_ostream_joiner(s, ", "));
+    s << "}" << std::endl;
+    return s;
+}
+
+std::ostream& operator<<(std::ostream& s, const std::vector<ListInstance> set)
+{
+    s << std::endl << "{" << std::endl;
+    std::transform(set.begin(), set.end(), std::experimental::make_ostream_joiner(s, ", \n"), [](const auto& map) {
+        std::ostringstream ss;
+        ss << "    {" << std::endl << "        ";
+        std::transform(map.begin(), map.end(), std::experimental::make_ostream_joiner(ss, ", \n        "), [](const auto& keyValue){
+            return "{" + keyValue.first + "{" + boost::core::demangle(keyValue.second.type().name()) + "}" + ", " + leafDataToString(keyValue.second) + "}";
+        });
+        ss << std::endl << "    }";
+        return ss.str();
+    });
+    s << std::endl << "}" << std::endl;
+    return s;
+}
 }
 
 std::ostream& operator<<(std::ostream& s, const boost::variant<dataPath_, schemaPath_, module_>& path)
@@ -170,3 +194,8 @@
     s << "\n}\n";
     return s;
 }
+
+std::ostream& operator<<(std::ostream& s, const set_ cmd)
+{
+    return s << "Command SET {path: " << pathToSchemaString(cmd.m_path, Prefixes::Always) << ", type " << boost::core::demangle(cmd.m_data.type().name()) << ", data: " << leafDataToString(cmd.m_data) << "}";
+}
diff --git a/tests/yang.cpp b/tests/yang.cpp
index 9419051..f50d76e 100644
--- a/tests/yang.cpp
+++ b/tests/yang.cpp
@@ -424,16 +424,6 @@
     }
 })";
 
-namespace std {
-std::ostream& operator<<(std::ostream& s, const std::set<std::string> set)
-{
-    s << std::endl << "{";
-    std::copy(set.begin(), set.end(), std::experimental::make_ostream_joiner(s, ", "));
-    s << "}" << std::endl;
-    return s;
-}
-}
-
 TEST_CASE("yangschema")
 {
     using namespace std::string_literals;
@@ -688,18 +678,16 @@
                 node.first = "example-schema";
                 node.second = "activePort";
 
-                yang::Enum enums = [&ys]() {
-                    SECTION("weird ports disabled")
-                    {
-                        return createEnum({"utf2", "utf3"});
-                    }
-                    SECTION("weird ports enabled")
-                    {
-                        ys.enableFeature("example-schema", "weirdPortNames");
-                        return createEnum({"WEIRD", "utf2", "utf3"});
-                    }
-                    __builtin_unreachable();
-                }();
+                yang::Enum enums({});
+                SECTION("weird ports disabled")
+                {
+                    enums = createEnum({"utf2", "utf3"});
+                }
+                SECTION("weird ports enabled")
+                {
+                    ys.enableFeature("example-schema", "weirdPortNames");
+                    enums = createEnum({"WEIRD", "utf2", "utf3"});
+                }
 
                 type = yang::Union{{
                     yang::TypeInfo{createEnum({"wlan0", "wlan1"})},