Get rid of push_back in favor of emplace_back

Change-Id: I4a0096441ed725eb21e42eb9cc17a173929e3788
diff --git a/src/ast_path.cpp b/src/ast_path.cpp
index 0d8a606..8a41279 100644
--- a/src/ast_path.cpp
+++ b/src/ast_path.cpp
@@ -336,7 +336,7 @@
             where.pop_back();
         }
     } else {
-        where.push_back(what);
+        where.emplace_back(what);
     }
 }
 }
diff --git a/src/grammars.hpp b/src/grammars.hpp
index 478e49f..742115b 100644
--- a/src/grammars.hpp
+++ b/src/grammars.hpp
@@ -211,7 +211,7 @@
             parserContext.m_tmpListPath = parserContext.currentDataPath();
             parserContext.m_tmpListPath.m_nodes.pop_back();
             auto list = list_{std::get<listElement_>(attr.m_source.m_nodes.back().m_suffix).m_name};
-            parserContext.m_tmpListPath.m_nodes.push_back(dataNode_{attr.m_source.m_nodes.back().m_prefix, list});
+            parserContext.m_tmpListPath.m_nodes.emplace_back(attr.m_source.m_nodes.back().m_prefix, list);
 
             res = (space_separator >> listSuffix).parse(begin, end, ctx, rctx, listInstance);
             if (res) {
diff --git a/src/libyang_utils.cpp b/src/libyang_utils.cpp
index a7dd682..756f88c 100644
--- a/src/libyang_utils.cpp
+++ b/src/libyang_utils.cpp
@@ -68,7 +68,7 @@
             }
         }
         if (it->schema()->nodetype() == LYS_LIST) {
-            res.push_back({stripXPathPrefix(it->path()), special_{SpecialValue::List}});
+            res.emplace_back(stripXPathPrefix(it->path()), special_{SpecialValue::List});
         }
         if (it->schema()->nodetype() == LYS_LEAF || it->schema()->nodetype() == LYS_LEAFLIST) {
             libyang::Data_Node_Leaf_List leaf(it);
diff --git a/src/netconf_access.cpp b/src/netconf_access.cpp
index ecdece0..689b2b5 100644
--- a/src/netconf_access.cpp
+++ b/src/netconf_access.cpp
@@ -169,7 +169,7 @@
     for (auto it : set->data()) {
         if (it->schema()->nodetype() == LYS_LEAF) {
             libyang::Data_Node_Leaf_List leaf(it);
-            res.push_back(leaf.value_str());
+            res.emplace_back(leaf.value_str());
         }
     }
     return res;
@@ -210,7 +210,7 @@
             auto leafSchema = libyang::Schema_Node_Leaf{leafData.schema()};
             instanceRes.insert({ leafSchema.name(), leafValueFromValue(leafData.value(), leafSchema.type()->base())});
         }
-        res.push_back(instanceRes);
+        res.emplace_back(instanceRes);
     }
 
     return res;
diff --git a/src/parser_context.cpp b/src/parser_context.cpp
index 17f6604..b50a248 100644
--- a/src/parser_context.cpp
+++ b/src/parser_context.cpp
@@ -52,7 +52,7 @@
         m_curPath = dataPathToSchemaPath(boost::get<dataPath_>(m_curPath));
     }
 
-    boost::get<schemaPath_>(m_curPath).m_nodes.push_back(node);
+    boost::get<schemaPath_>(m_curPath).m_nodes.emplace_back(node);
 }
 
 void ParserContext::resetPath()
diff --git a/src/path_parser.hpp b/src/path_parser.hpp
index 39e2797..9fa3db1 100644
--- a/src/path_parser.hpp
+++ b/src/path_parser.hpp
@@ -178,7 +178,7 @@
                 if (std::holds_alternative<listElement_>(attr.m_suffix)) {
                     parserContext.m_tmpListPath = parserContext.currentDataPath();
                     auto tmpList = list_{std::get<listElement_>(attr.m_suffix).m_name};
-                    parserContext.m_tmpListPath.m_nodes.push_back(dataNode_{attr.m_prefix, tmpList});
+                    parserContext.m_tmpListPath.m_nodes.emplace_back(attr.m_prefix, tmpList);
 
                     res = listSuffix.parse(begin, end, ctx, rctx, std::get<listElement_>(attr.m_suffix).m_keys);
 
@@ -284,7 +284,7 @@
                 dataNode_ attrNodeList;
                 res = incompleteDataNode<COMPLETION_MODE>{m_filterFunction}.parse(begin, end, ctx, rctx, attrNodeList);
                 if (res) {
-                    attrData.m_nodes.push_back(attrNodeList);
+                    attrData.m_nodes.emplace_back(attrNodeList);
                     // If the trailing slash matches, no more nodes are parsed.
                     // That means no more completion. So, I generate them
                     // manually.
diff --git a/src/sysrepo_access.cpp b/src/sysrepo_access.cpp
index 61ff560..17c86a0 100644
--- a/src/sysrepo_access.cpp
+++ b/src/sysrepo_access.cpp
@@ -197,15 +197,15 @@
         for (unsigned int i = 0; i < items->val_cnt(); i++) {
             auto value = leafValueFromVal(items->val(i));
             if (m_schema->nodeType(items->val(i)->xpath()) == yang::NodeTypes::LeafList) {
-                res.push_back({items->val(i)->xpath(), special_{SpecialValue::LeafList}});
+                res.emplace_back(items->val(i)->xpath(), special_{SpecialValue::LeafList});
                 std::string leafListPath = items->val(i)->xpath();
                 while (i < items->val_cnt() && leafListPath == items->val(i)->xpath()) {
                     auto leafListValue = leafDataToString(leafValueFromVal(items->val(i)));
-                    res.push_back({items->val(i)->xpath() + "[.="s + escapeListKeyString(leafListValue) + "]", leafListValue});
+                    res.emplace_back(items->val(i)->xpath() + "[.="s + escapeListKeyString(leafListValue) + "]", leafListValue);
                     i++;
                 }
             } else {
-                res.push_back({items->val(i)->xpath(), value});
+                res.emplace_back(items->val(i)->xpath(), value);
             }
         }
     };
@@ -315,7 +315,7 @@
     Tree res;
     for (size_t i = 0; i < output->val_cnt(); ++i) {
         const auto& v = output->val(i);
-        res.push_back({std::string(v->xpath()).substr(joinPaths(path, "/").size()), leafValueFromVal(v)});
+        res.emplace_back(std::string(v->xpath()).substr(joinPaths(path, "/").size()), leafValueFromVal(v));
     }
     return res;
 }
@@ -354,7 +354,7 @@
     }
     for (unsigned int i = 0; i < schemas->schema_cnt(); i++) {
         auto schema = schemas->schema(i);
-        res.push_back(schema);
+        res.emplace_back(schema);
     }
     return res;
 }
@@ -427,7 +427,7 @@
             auto leaf = libyang::Data_Node_Leaf_List{*(vec.begin())};
             instanceRes.emplace(key->name(), leafValueFromValue(leaf.value(), leaf.leaf_type()->base()));
         }
-        res.push_back(instanceRes);
+        res.emplace_back(instanceRes);
     }
 
     return res;
diff --git a/src/yang_access.cpp b/src/yang_access.cpp
index d5c0ade..79d1c08 100644
--- a/src/yang_access.cpp
+++ b/src/yang_access.cpp
@@ -260,7 +260,7 @@
                 }
             }
         }
-        res.push_back(instance);
+        res.emplace_back(instance);
     }
     return res;
 }
diff --git a/src/yang_schema.cpp b/src/yang_schema.cpp
index 4b65e13..9e63348 100644
--- a/src/yang_schema.cpp
+++ b/src/yang_schema.cpp
@@ -248,7 +248,7 @@
             {
                 auto resUnion = yang::Union{};
                 for (auto unionType : type->info()->uni()->types()) {
-                    resUnion.m_unionTypes.push_back(resolveType(unionType));
+                    resUnion.m_unionTypes.emplace_back(resolveType(unionType));
                 }
                 resType.emplace<yang::Union>(std::move(resUnion));
                 break;
diff --git a/tests/cd.cpp b/tests/cd.cpp
index e0d6293..0c5411b 100644
--- a/tests/cd.cpp
+++ b/tests/cd.cpp
@@ -51,7 +51,7 @@
                 {
                     input = "cd example:a";
                 }
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
             }
 
             SECTION("second:a")
@@ -65,34 +65,34 @@
                 {
                     input = "cd second:a";
                 }
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"second"}, container_("a")));
+                expected.m_path.m_nodes.emplace_back(module_{"second"}, container_("a"));
             }
 
             SECTION("example:b")
             {
                 input = "cd example:b";
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("b")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("b"));
             }
 
             SECTION("example:a/a2")
             {
                 input = "cd example:a/a2";
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
-                expected.m_path.m_nodes.push_back(dataNode_(container_("a2")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
+                expected.m_path.m_nodes.emplace_back(container_("a2"));
             }
 
             SECTION("example:a/example:a2")
             {
                 input = "cd example:a/example:a2";
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a2")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a2"));
             }
 
             SECTION("example:b/b2")
             {
                 input = "cd example:b/b2";
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("b")));
-                expected.m_path.m_nodes.push_back(dataNode_(container_("b2")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("b"));
+                expected.m_path.m_nodes.emplace_back(container_("b2"));
             }
         }
 
@@ -103,7 +103,7 @@
                 input = "cd example:list[number=1]";
                 auto keys = ListInstance {
                     {"number", int32_t{1}}};
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, listElement_("list", keys)));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, listElement_("list", keys));
             }
 
             SECTION("example:list[number=1]/contInList")
@@ -111,8 +111,8 @@
                 input = "cd example:list[number=1]/contInList";
                 auto keys = ListInstance {
                     {"number", int32_t{1}}};
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, listElement_("list", keys)));
-                expected.m_path.m_nodes.push_back(dataNode_(container_("contInList")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, listElement_("list", keys));
+                expected.m_path.m_nodes.emplace_back(container_("contInList"));
             }
 
             SECTION("example:twoKeyList[number=4][name='abcd']")
@@ -121,7 +121,7 @@
                 auto keys = ListInstance {
                     {"number", int32_t{4}},
                     {"name", std::string{"abcd"}}};
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, listElement_("twoKeyList", keys)));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, listElement_("twoKeyList", keys));
             }
         }
 
@@ -130,7 +130,7 @@
             SECTION("  cd   example:a     ")
             {
                 input = "  cd   example:a     ";
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
             }
         }
 
@@ -139,38 +139,38 @@
             SECTION("moving up when already in root")
             {
                 input = "cd ..";
-                expected.m_path.m_nodes.push_back(dataNode_(nodeup_()));
+                expected.m_path.m_nodes.emplace_back(nodeup_());
             }
 
             SECTION("moving up TWICE when already in root")
             {
                 input = "cd ../..";
-                expected.m_path.m_nodes.push_back(dataNode_(nodeup_()));
-                expected.m_path.m_nodes.push_back(dataNode_(nodeup_()));
+                expected.m_path.m_nodes.emplace_back(nodeup_());
+                expected.m_path.m_nodes.emplace_back(nodeup_());
             }
 
             SECTION("example:a/..")
             {
                 input = "cd example:a/..";
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
-                expected.m_path.m_nodes.push_back(dataNode_(nodeup_()));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
+                expected.m_path.m_nodes.emplace_back(nodeup_());
             }
 
             SECTION("example:a/../example:a")
             {
                 input = "cd example:a/../example:a";
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
-                expected.m_path.m_nodes.push_back(dataNode_(nodeup_()));
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
+                expected.m_path.m_nodes.emplace_back(nodeup_());
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
             }
 
             SECTION("example:a/../example:a/a2")
             {
                 input = "cd example:a/../example:a/a2";
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
-                expected.m_path.m_nodes.push_back(dataNode_(nodeup_()));
-                expected.m_path.m_nodes.push_back(dataNode_(module_{"example"}, container_("a")));
-                expected.m_path.m_nodes.push_back(dataNode_(container_("a2")));
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
+                expected.m_path.m_nodes.emplace_back(nodeup_());
+                expected.m_path.m_nodes.emplace_back(module_{"example"}, container_("a"));
+                expected.m_path.m_nodes.emplace_back(container_("a2"));
             }
         }
 
diff --git a/tests/data_query.cpp b/tests/data_query.cpp
index f6f7343..023f6e6 100644
--- a/tests/data_query.cpp
+++ b/tests/data_query.cpp
@@ -56,7 +56,7 @@
             datastore.createItem("/example-schema:person[name='Vaclav']");
             datastore.createItem("/example-schema:person[name='Tomas']");
             datastore.createItem("/example-schema:person[name='Jan Novak']");
-            listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"person"}});
+            listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"person"});
             expected = {
                 {{"name", std::string{"Jan Novak"}}},
                 {{"name", std::string{"Tomas"}}},
@@ -66,7 +66,7 @@
 
         SECTION("example-schema:person - no instances")
         {
-            listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"person"}});
+            listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"person"});
             expected = {
             };
         }
@@ -76,7 +76,7 @@
             datastore.createItem("/example-schema:selectedNumbers[value='45']");
             datastore.createItem("/example-schema:selectedNumbers[value='99']");
             datastore.createItem("/example-schema:selectedNumbers[value='127']");
-            listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"selectedNumbers"}});
+            listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"selectedNumbers"});
             expected = {
                 {{"value", int8_t{127}}},
                 {{"value", int8_t{45}}},
@@ -89,7 +89,7 @@
             datastore.createItem("/example-schema:animalWithColor[name='Dog'][color='brown']");
             datastore.createItem("/example-schema:animalWithColor[name='Dog'][color='white']");
             datastore.createItem("/example-schema:animalWithColor[name='Cat'][color='grey']");
-            listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"animalWithColor"}});
+            listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"animalWithColor"});
             expected = {
                 {{"name", std::string{"Cat"}}, {"color", std::string{"grey"}}},
                 {{"name", std::string{"Dog"}}, {"color", std::string{"brown"}}},
@@ -100,7 +100,7 @@
         SECTION("example-schema:animalWithColor - quotes in values")
         {
             datastore.createItem("/example-schema:animalWithColor[name='D\"o\"g'][color=\"b'r'own\"]");
-            listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"animalWithColor"}});
+            listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"animalWithColor"});
             expected = {
                 {{"name", std::string{"D\"o\"g"}}, {"color", std::string{"b'r'own"}}}
             };
@@ -111,7 +111,7 @@
             datastore.createItem("/example-schema:ports[name='A']");
             datastore.createItem("/example-schema:ports[name='B']");
             datastore.createItem("/example-schema:ports[name='E']");
-            listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"ports"}});
+            listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"ports"});
             expected = {
                 {{"name", enum_{"A"}}},
                 {{"name", enum_{"B"}}},
@@ -135,7 +135,7 @@
 
             SECTION("outer list")
             {
-                listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"org"}});
+                listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"org"});
                 expected = {
                     {{"department", std::string{"accounting"}}},
                     {{"department", std::string{"sales"}}},
@@ -175,8 +175,8 @@
                     expected = {
                     };
                 }
-                listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list});
-                listPath.m_nodes.push_back(dataNode_{list_{"people"}});
+                listPath.m_nodes.emplace_back(module_{"example-schema"}, list);
+                listPath.m_nodes.emplace_back(list_{"people"});
             }
 
             SECTION("THREE MF NESTED LISTS")
@@ -214,9 +214,9 @@
                     };
                 }
 
-                listPath.m_nodes.push_back(dataNode_{{"example-schema"}, listOrg});
-                listPath.m_nodes.push_back(dataNode_{listPeople});
-                listPath.m_nodes.push_back(dataNode_{list_{"computers"}});
+                listPath.m_nodes.emplace_back(module_{"example-schema"}, listOrg);
+                listPath.m_nodes.emplace_back(listPeople);
+                listPath.m_nodes.emplace_back(list_{"computers"});
             }
         }
 
@@ -225,8 +225,8 @@
             datastore.createItem("/other-module:parking-lot/example-schema:cars[id='1']");
             datastore.createItem("/other-module:parking-lot/example-schema:cars[id='2']");
 
-            listPath.m_nodes.push_back(dataNode_{{"other-module"}, container_{"parking-lot"}});
-            listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"cars"}});
+            listPath.m_nodes.emplace_back(module_{"other-module"}, container_{"parking-lot"});
+            listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"cars"});
             expected = {
                 {{"id", int32_t{1}}},
                 {{"id", int32_t{2}}},
@@ -245,7 +245,7 @@
     {
         dataPath_ listPath;
         listPath.m_scope = Scope::Absolute;
-        listPath.m_nodes.push_back(dataNode_{{"example-schema"}, list_{"person"}});
+        listPath.m_nodes.emplace_back(module_{"example-schema"}, list_{"person"});
         auto keys = dataquery.listKeys(listPath);
         REQUIRE(keys == std::vector<ListInstance>{});
     }
diff --git a/tests/interpreter.cpp b/tests/interpreter.cpp
index d1e6d26..3b9736b 100644
--- a/tests/interpreter.cpp
+++ b/tests/interpreter.cpp
@@ -173,9 +173,9 @@
         }
         ls_ ls;
         ls.m_path = lsArg;
-        expectations.push_back(NAMED_REQUIRE_CALL(datastore, schema()).RETURN(schema));
-        expectations.push_back(NAMED_REQUIRE_CALL(*schema, availableNodes(expectedPath, Recursion::NonRecursive)).RETURN(std::set<ModuleNodePair>{}));
-        toInterpret.push_back(ls);
+        expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, schema()).RETURN(schema));
+        expectations.emplace_back(NAMED_REQUIRE_CALL(*schema, availableNodes(expectedPath, Recursion::NonRecursive)).RETURN(std::set<ModuleNodePair>{}));
+        toInterpret.emplace_back(ls);
     }
 
     SECTION("get")
@@ -323,8 +323,8 @@
 
         get_ getCmd;
         getCmd.m_path = inputPath;
-        expectations.push_back(NAMED_REQUIRE_CALL(datastore, getItems(expectedPathArg)).RETURN(treeReturned));
-        toInterpret.push_back(getCmd);
+        expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, getItems(expectedPathArg)).RETURN(treeReturned));
+        toInterpret.emplace_back(getCmd);
     }
 
     SECTION("create/delete")
@@ -335,50 +335,50 @@
         SECTION("list instance")
         {
             inputPath.m_nodes = {dataNode_{{"mod"}, listElement_{"department", {{"name", "engineering"s}}}}};
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, createItem("/mod:department[name='engineering']")));
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, deleteItem("/mod:department[name='engineering']")));
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, createItem("/mod:department[name='engineering']")));
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, deleteItem("/mod:department[name='engineering']")));
         }
 
         SECTION("leaflist instance")
         {
             inputPath.m_nodes = {dataNode_{{"mod"}, leafListElement_{"addresses", "127.0.0.1"s}}};
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, createItem("/mod:addresses[.='127.0.0.1']")));
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, deleteItem("/mod:addresses[.='127.0.0.1']")));
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, createItem("/mod:addresses[.='127.0.0.1']")));
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, deleteItem("/mod:addresses[.='127.0.0.1']")));
         }
 
         SECTION("presence container")
         {
             inputPath.m_nodes = {dataNode_{{"mod"}, container_{"pContainer"}}};
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, createItem("/mod:pContainer")));
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, deleteItem("/mod:pContainer")));
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, createItem("/mod:pContainer")));
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, deleteItem("/mod:pContainer")));
         }
 
         create_ createCmd;
         createCmd.m_path = inputPath;
         delete_ deleteCmd;
         deleteCmd.m_path = inputPath;
-        toInterpret.push_back(createCmd);
-        toInterpret.push_back(deleteCmd);
+        toInterpret.emplace_back(createCmd);
+        toInterpret.emplace_back(deleteCmd);
     }
 
     SECTION("delete a leaf")
     {
-        expectations.push_back(NAMED_REQUIRE_CALL(datastore, deleteItem("/mod:someLeaf")));
+        expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, deleteItem("/mod:someLeaf")));
         delete_ deleteCmd;
         deleteCmd.m_path = {Scope::Absolute, {dataNode_{{"mod"}, leaf_{"someLeaf"}}, }};
-        toInterpret.push_back(deleteCmd);
+        toInterpret.emplace_back(deleteCmd);
     }
 
     SECTION("commit")
     {
-        expectations.push_back(NAMED_REQUIRE_CALL(datastore, commitChanges()));
-        toInterpret.push_back(commit_{});
+        expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, commitChanges()));
+        toInterpret.emplace_back(commit_{});
     }
 
     SECTION("discard")
     {
-        expectations.push_back(NAMED_REQUIRE_CALL(datastore, discardChanges()));
-        toInterpret.push_back(discard_{});
+        expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, discardChanges()));
+        toInterpret.emplace_back(discard_{});
     }
 
 
@@ -391,14 +391,14 @@
         {
             inputPath.m_nodes = {dataNode_{{"mod"}, leaf_{"animal"}}};
             inputData = identityRef_{"Doge"};
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, setLeaf("/mod:animal", identityRef_{"mod", "Doge"})));
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, setLeaf("/mod:animal", identityRef_{"mod", "Doge"})));
         }
 
 
         set_ setCmd;
         setCmd.m_path = inputPath;
         setCmd.m_data = inputData;
-        toInterpret.push_back(setCmd);
+        toInterpret.emplace_back(setCmd);
     }
 
 
@@ -406,14 +406,14 @@
     {
         SECTION("running -> startup")
         {
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, copyConfig(Datastore::Running, Datastore::Startup)));
-            toInterpret.push_back(copy_{{}, Datastore::Running, Datastore::Startup});
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, copyConfig(Datastore::Running, Datastore::Startup)));
+            toInterpret.emplace_back(copy_{{}, Datastore::Running, Datastore::Startup});
         }
 
         SECTION("startup -> running")
         {
-            expectations.push_back(NAMED_REQUIRE_CALL(datastore, copyConfig(Datastore::Startup, Datastore::Running)));
-            toInterpret.push_back(copy_{{}, Datastore::Startup, Datastore::Running});
+            expectations.emplace_back(NAMED_REQUIRE_CALL(datastore, copyConfig(Datastore::Startup, Datastore::Running)));
+            toInterpret.emplace_back(copy_{{}, Datastore::Startup, Datastore::Running});
         }
     }
 
diff --git a/tests/keyvalue_completion.cpp b/tests/keyvalue_completion.cpp
index dd826f4..7b28ea8 100644
--- a/tests/keyvalue_completion.cpp
+++ b/tests/keyvalue_completion.cpp
@@ -56,8 +56,7 @@
             "9",
             "42"
         };
-        queryExpectations.push_back(NAMED_REQUIRE_CALL(*mockDatastore, listInstances("/example:list"))
-            .RETURN(queryReturn));
+        queryExpectations.emplace_back(NAMED_REQUIRE_CALL(*mockDatastore, listInstances("/example:list")).RETURN(queryReturn));
     }
 
     SECTION("get example:twoKeyList[number=")
@@ -82,8 +81,7 @@
                 input += "name=";
                 expected = { "'Petr'", "'Honza'"};
             }
-            queryExpectations.push_back(NAMED_REQUIRE_CALL(*mockDatastore, listInstances("/example:twoKeyList"))
-                    .RETURN(queryReturn));
+            queryExpectations.emplace_back(NAMED_REQUIRE_CALL(*mockDatastore, listInstances("/example:twoKeyList")).RETURN(queryReturn));
         }
 
         SECTION("name is set")
@@ -100,7 +98,7 @@
                 expected = { "10", "100" };
             }
             input += "][number=";
-            queryExpectations.push_back(NAMED_REQUIRE_CALL(*mockDatastore, listInstances("/example:twoKeyList"))
+            queryExpectations.emplace_back(NAMED_REQUIRE_CALL(*mockDatastore, listInstances("/example:twoKeyList"))
                     .TIMES(2)
                     .RETURN(queryReturn));
         }
@@ -129,7 +127,7 @@
                 expected = { "'Honza'" };
             }
             input += "][name=";
-            queryExpectations.push_back(NAMED_REQUIRE_CALL(*mockDatastore, listInstances("/example:twoKeyList"))
+            queryExpectations.emplace_back(NAMED_REQUIRE_CALL(*mockDatastore, listInstances("/example:twoKeyList"))
                     .TIMES(2)
                     .RETURN(queryReturn));
         }
@@ -151,7 +149,7 @@
                 input = "get example:twoKeyList[number=123][name='Petr'][";
             }
             // I use ALLOW_CALL here, all this stuff calls it different number of times
-            queryExpectations.push_back(NAMED_ALLOW_CALL(*mockDatastore, listInstances("/example:twoKeyList"))
+            queryExpectations.emplace_back(NAMED_ALLOW_CALL(*mockDatastore, listInstances("/example:twoKeyList"))
                     .RETURN(queryReturn));
         }
 
diff --git a/tests/leaf_editing.cpp b/tests/leaf_editing.cpp
index 35e2ddc..53194c0 100644
--- a/tests/leaf_editing.cpp
+++ b/tests/leaf_editing.cpp
@@ -82,39 +82,39 @@
         SECTION("set mod:leafString \"some_data\"")
         {
             input = "set mod:leafString \'some_data\'";
-            expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafString")});
+            expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafString"));
             expected.m_data = std::string("some_data");
         }
 
         SECTION("set mod:contA/leafInCont 'more_data'")
         {
             input = "set mod:contA/leafInCont 'more_data'";
-            expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, container_("contA")});
-            expected.m_path.m_nodes.push_back(dataNode_{leaf_("leafInCont")});
+            expected.m_path.m_nodes.emplace_back(module_{"mod"}, container_("contA"));
+            expected.m_path.m_nodes.emplace_back(leaf_("leafInCont"));
             expected.m_data = std::string("more_data");
         }
 
         SECTION("set mod:contA/leafInCont \"data with' a quote\"")
         {
             input = "set mod:contA/leafInCont \"data with' a quote\"";
-            expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, container_("contA")});
-            expected.m_path.m_nodes.push_back(dataNode_{leaf_("leafInCont")});
+            expected.m_path.m_nodes.emplace_back(module_{"mod"}, container_("contA"));
+            expected.m_path.m_nodes.emplace_back(leaf_("leafInCont"));
             expected.m_data = std::string("data with' a quote");
         }
 
         SECTION("set mod:contA/leafInCont 'data with\" a quote'")
         {
             input = "set mod:contA/leafInCont 'data with\" a quote'";
-            expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, container_("contA")});
-            expected.m_path.m_nodes.push_back(dataNode_{leaf_("leafInCont")});
+            expected.m_path.m_nodes.emplace_back(module_{"mod"}, container_("contA"));
+            expected.m_path.m_nodes.emplace_back(leaf_("leafInCont"));
             expected.m_data = std::string("data with\" a quote");
         }
 
         SECTION("set mod:contA/leafInCont   'more   d\tata'") // spaces in string
         {
             input = "set mod:contA/leafInCont 'more   d\tata'";
-            expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, container_("contA")});
-            expected.m_path.m_nodes.push_back(dataNode_{leaf_("leafInCont")});
+            expected.m_path.m_nodes.emplace_back(module_{"mod"}, container_("contA"));
+            expected.m_path.m_nodes.emplace_back(leaf_("leafInCont"));
             expected.m_data = std::string("more   d\tata");
         }
 
@@ -123,8 +123,8 @@
             input = "set mod:list[number=1]/leafInList \"another_data\"";
             auto keys = ListInstance {
                 {"number", int32_t{1}}};
-            expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, listElement_("list", keys)});
-            expected.m_path.m_nodes.push_back(dataNode_{leaf_("leafInList")});
+            expected.m_path.m_nodes.emplace_back(module_{"mod"}, listElement_("list", keys));
+            expected.m_path.m_nodes.emplace_back(leaf_("leafInList"));
             expected.m_data = std::string("another_data");
         }
 
@@ -133,91 +133,91 @@
             SECTION("string")
             {
                 input = "set mod:leafString \"somedata\"";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafString")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafString"));
                 expected.m_data = std::string("somedata");
             }
 
             SECTION("int8")
             {
                 input = "set mod:leafInt8 2";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt8")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafInt8"));
                 expected.m_data = int8_t{2};
             }
 
             SECTION("negative int8")
             {
                 input = "set mod:leafInt8 -10";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt8")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafInt8"));
                 expected.m_data = int8_t{-10};
             }
 
             SECTION("uint8")
             {
                 input = "set mod:leafUint8 2";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafUint8")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafUint8"));
                 expected.m_data = uint8_t{2};
             }
 
             SECTION("int16")
             {
                 input = "set mod:leafInt16 30000";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt16")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafInt16"));
                 expected.m_data = int16_t{30'000};
             }
 
             SECTION("uint16")
             {
                 input = "set mod:leafUint16 30000";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafUint16")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafUint16"));
                 expected.m_data = uint16_t{30'000};
             }
 
             SECTION("int32")
             {
                 input = "set mod:leafInt32 30000";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt32")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafInt32"));
                 expected.m_data = int32_t{30'000};
             }
 
             SECTION("uint32")
             {
                 input = "set mod:leafUint32 30000";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafUint32")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafUint32"));
                 expected.m_data = uint32_t{30'000};
             }
 
             SECTION("int32")
             {
                 input = "set mod:leafInt32 30000";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt32")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafInt32"));
                 expected.m_data = int32_t{30'000};
             }
 
             SECTION("uint64")
             {
                 input = "set mod:leafUint64 30000";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafUint64")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafUint64"));
                 expected.m_data = uint64_t{30'000};
             }
 
             SECTION("decimal")
             {
                 input = "set mod:leafDecimal 3.14159";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafDecimal")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafDecimal"));
                 expected.m_data = 3.14159;
             }
 
             SECTION("enum")
             {
                 input = "set mod:leafEnum coze";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafEnum")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafEnum"));
                 expected.m_data = enum_("coze");
             }
 
             SECTION("bool")
             {
                 input = "set mod:leafBool true";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafBool")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafBool"));
                 expected.m_data = true;
             }
 
@@ -225,20 +225,20 @@
             {
                 SECTION("int")
                 {
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("intOrString")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("intOrString"));
                     input = "set mod:intOrString 90";
                     expected.m_data = int32_t{90};
                 }
                 SECTION("string")
                 {
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("intOrString")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("intOrString"));
                     input = "set mod:intOrString \"test\"";
                     expected.m_data = std::string{"test"};
                 }
 
                 SECTION("union with two integral types")
                 {
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("twoInts")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("twoInts"));
                     SECTION("uint8")
                     {
                         input = "set mod:twoInts 100";
@@ -253,7 +253,7 @@
 
                 SECTION("union with enum and leafref to enum")
                 {
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("unionStringEnumLeafref")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("unionStringEnumLeafref"));
                     SECTION("string")
                     {
                         input = "set mod:unionStringEnumLeafref \"AHOJ\"";
@@ -273,7 +273,7 @@
 
                 SECTION("activePort")
                 {
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("activePort")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("activePort"));
                     input = "set mod:activePort ";
                     SECTION("1. anonymous enum")
                     {
@@ -350,7 +350,7 @@
                     input = "set mod:leafBinary This/IsABase64EncodedSomething++/342431++==";
                     expected.m_data = binary_{"This/IsABase64EncodedSomething++/342431++=="};
                 }
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafBinary")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafBinary"));
             }
 
             SECTION("identityRef")
@@ -358,7 +358,7 @@
                 SECTION("foodIdentRef")
                 {
                     input = "set mod:foodIdentRef ";
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("foodIdentRef")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("foodIdentRef"));
 
                     SECTION("food")
                     {
@@ -389,7 +389,7 @@
                 SECTION("pizzaIdentRef")
                 {
                     input = "set mod:pizzaIdentRef ";
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("pizzaIdentRef")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("pizzaIdentRef"));
                     SECTION("pizza")
                     {
                         input += "pizza";
@@ -409,8 +409,8 @@
                 SECTION("mod:contA/identInCont")
                 {
                     input = "set mod:contA/identInCont ";
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, container_("contA")});
-                    expected.m_path.m_nodes.push_back(dataNode_(leaf_("identInCont")));
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, container_("contA"));
+                    expected.m_path.m_nodes.emplace_back(leaf_("identInCont"));
                     SECTION("pizza")
                     {
                         input += "pizza";
@@ -433,28 +433,28 @@
                 SECTION("refToString")
                 {
                     input = "set mod:refToString \"blabal\"";
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("refToString")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("refToString"));
                     expected.m_data = std::string("blabal");
                 }
 
                 SECTION("refToInt8")
                 {
                     input = "set mod:refToInt8 42";
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("refToInt8")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("refToInt8"));
                     expected.m_data = int8_t{42};
                 }
 
                 SECTION("refToLeafInCont")
                 {
                     input = "set mod:refToLeafInCont pizza";
-                    expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("refToLeafInCont")});
+                    expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("refToLeafInCont"));
                     expected.m_data = identityRef_{"pizza"};
                 }
             }
             SECTION("empty")
             {
                 input = "set mod:dummy ";
-                expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("dummy")});
+                expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("dummy"));
                 expected.m_data = empty_{};
             }
         }
@@ -622,7 +622,7 @@
     {
         delete_ expected;
         input = "delete mod:leafString";
-        expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafString")});
+        expected.m_path.m_nodes.emplace_back(module_{"mod"}, leaf_("leafString"));
 
         command_ command = parser.parseCommand(input, errorStream);
         REQUIRE(command.type() == typeid(delete_));
diff --git a/tests/list_manipulation.cpp b/tests/list_manipulation.cpp
index c646e13..e9dd466 100644
--- a/tests/list_manipulation.cpp
+++ b/tests/list_manipulation.cpp
@@ -39,7 +39,7 @@
             input = "mod:list[number=3]";
             auto keys = ListInstance {
                 {"number", int32_t{3}}};
-            expectedPath.m_nodes.push_back(dataNode_{module_{"mod"}, listElement_("list", keys)});
+            expectedPath.m_nodes.emplace_back(module_{"mod"}, listElement_("list", keys));
         }
 
         SECTION("mod:company[department=other:engineering]/inventory[id=1337]")
@@ -47,16 +47,16 @@
             input = "mod:company[department=other:engineering]/inventory[id=1337]";
             auto keys = ListInstance {
                 {"department", identityRef_{"other", "engineering"}}};
-            expectedPath.m_nodes.push_back(dataNode_{module_{"mod"}, listElement_("company", keys)});
+            expectedPath.m_nodes.emplace_back(module_{"mod"}, listElement_("company", keys));
             keys = ListInstance {
                 {"id", int32_t{1337}}};
-            expectedPath.m_nodes.push_back(dataNode_{listElement_("inventory", keys)});
+            expectedPath.m_nodes.emplace_back(listElement_("inventory", keys));
         }
 
         SECTION("create mod:addresses['0.0.0.0']")
         {
             input = "mod:addresses['0.0.0.0']";
-            expectedPath.m_nodes.push_back(dataNode_{module_{"mod"}, leafListElement_{"addresses", "0.0.0.0"s}});
+            expectedPath.m_nodes.emplace_back(module_{"mod"}, leafListElement_{"addresses", "0.0.0.0"s});
         }
 
 
@@ -76,7 +76,7 @@
     {
         dataPath_ expected;
         input = "get mod:addresses";
-        expected.m_nodes.push_back(dataNode_{module_{"mod"}, leafList_{"addresses"}});
+        expected.m_nodes.emplace_back(module_{"mod"}, leafList_{"addresses"});
 
         get_ expectedGet;
         expectedGet.m_path = expected;
@@ -93,7 +93,7 @@
             SECTION("cwd: /")
             {
                 input = "move mod:addresses['1.2.3.4'] begin";
-                expected.m_source.m_nodes.push_back(dataNode_{module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s}});
+                expected.m_source.m_nodes.emplace_back(module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s});
             }
 
             SECTION("cwd: /mod:cont")
@@ -102,15 +102,15 @@
                 SECTION("relative")
                 {
                     input = "move ../mod:addresses['1.2.3.4'] begin";
-                    expected.m_source.m_nodes.push_back(dataNode_{nodeup_{}});
-                    expected.m_source.m_nodes.push_back(dataNode_{module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s}});
+                    expected.m_source.m_nodes.emplace_back(nodeup_{});
+                    expected.m_source.m_nodes.emplace_back(module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s});
                 }
 
                 SECTION("absolute")
                 {
                     input = "move /mod:addresses['1.2.3.4'] begin";
                     expected.m_source.m_scope = Scope::Absolute;
-                    expected.m_source.m_nodes.push_back(dataNode_{module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s}});
+                    expected.m_source.m_nodes.emplace_back(module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s});
                 }
             }
 
@@ -120,14 +120,14 @@
         SECTION("end")
         {
             input = "move mod:addresses['1.2.3.4'] end";
-            expected.m_source.m_nodes.push_back(dataNode_{module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s}});
+            expected.m_source.m_nodes.emplace_back(module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s});
             expected.m_destination = yang::move::Absolute::End;
         }
 
         SECTION("after")
         {
             input = "move mod:addresses['1.2.3.4'] after '0.0.0.0'";
-            expected.m_source.m_nodes.push_back(dataNode_{module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s}});
+            expected.m_source.m_nodes.emplace_back(module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s});
             expected.m_destination = yang::move::Relative {
                 yang::move::Relative::Position::After,
                 {{".", "0.0.0.0"s}}
@@ -137,7 +137,7 @@
         SECTION("before")
         {
             input = "move mod:addresses['1.2.3.4'] before '0.0.0.0'";
-            expected.m_source.m_nodes.push_back(dataNode_{module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s}});
+            expected.m_source.m_nodes.emplace_back(module_{"mod"}, leafListElement_{"addresses", "1.2.3.4"s});
             expected.m_destination = yang::move::Relative {
                 yang::move::Relative::Position::Before,
                 {{".", "0.0.0.0"s}}
@@ -149,7 +149,7 @@
             input = "move mod:list[number=12] before [number=15]";
             auto keys = std::map<std::string, leaf_data_>{
                 {"number", int32_t{12}}};
-            expected.m_source.m_nodes.push_back(dataNode_{module_{"mod"}, listElement_("list", keys)});
+            expected.m_source.m_nodes.emplace_back(module_{"mod"}, listElement_("list", keys));
             expected.m_destination = yang::move::Relative {
                 yang::move::Relative::Position::Before,
                 ListInstance{{"number", int32_t{15}}}
@@ -161,7 +161,7 @@
             input = "move mod:list[number=3] begin";
             auto keys = std::map<std::string, leaf_data_>{
                 {"number", int32_t{3}}};
-            expected.m_source.m_nodes.push_back(dataNode_{module_{"mod"}, listElement_("list", keys)});
+            expected.m_source.m_nodes.emplace_back(module_{"mod"}, listElement_("list", keys));
             expected.m_destination = yang::move::Absolute::Begin;
         }
 
diff --git a/tests/ls.cpp b/tests/ls.cpp
index 0a91dfb..58d4add 100644
--- a/tests/ls.cpp
+++ b/tests/ls.cpp
@@ -48,7 +48,7 @@
             SECTION("ls --recursive")
             {
                 input = "ls --recursive";
-                expected.m_options.push_back(LsOption::Recursive);
+                expected.m_options.emplace_back(LsOption::Recursive);
             }
         }
 
@@ -142,7 +142,7 @@
                 SECTION("cwd: /example:a") { parser.changeNode(dataPath_{Scope::Relative, {dataNode_(module_{"example"}, container_{"a"})}}); }
 
                 input = "ls --recursive /example:a";
-                expected.m_options.push_back(LsOption::Recursive);
+                expected.m_options.emplace_back(LsOption::Recursive);
                 expected.m_path = dataPath_{Scope::Absolute, {dataNode_(module_{"example"}, container_{"a"})}};
             }
 
diff --git a/tests/path_utils.cpp b/tests/path_utils.cpp
index 6765001..851cd0a 100644
--- a/tests/path_utils.cpp
+++ b/tests/path_utils.cpp
@@ -25,7 +25,7 @@
             {
                 path.m_scope = Scope::Relative;
             }
-            path.m_nodes.push_back(dataNode_{module_{"example-schema"}, listElement_{"twoKeyList", {{"first", std::string{"a"}}, {"second", std::string{"b"}}}}});
+            path.m_nodes.emplace_back(module_{"example-schema"}, listElement_{"twoKeyList", {{"first", std::string{"a"}}, {"second", std::string{"b"}}}});
             expected += "example-schema:twoKeyList[first='a'][second='b']";
         }
 
@@ -40,7 +40,7 @@
             {
                 path.m_scope = Scope::Relative;
             }
-            path.m_nodes.push_back(dataNode_{module_{"example-schema"}, leafListElement_{"addresses", std::string{"0.0.0.0"}}});
+            path.m_nodes.emplace_back(module_{"example-schema"}, leafListElement_{"addresses", std::string{"0.0.0.0"}});
             expected += "example-schema:addresses[.='0.0.0.0']";
         }
         REQUIRE(pathToDataString(path, Prefixes::WhenNeeded) == expected);
diff --git a/tests/yang.cpp b/tests/yang.cpp
index 843e1a8..cee9e9a 100644
--- a/tests/yang.cpp
+++ b/tests/yang.cpp
@@ -460,7 +460,7 @@
 
             SECTION("_list")
             {
-                path.m_nodes.push_back(schemaNode_{module_{"example-schema"}, list_{"_list"}});
+                path.m_nodes.emplace_back(module_{"example-schema"}, list_{"_list"});
                 SECTION("number")
                 {
                     key = "number";
@@ -469,7 +469,7 @@
 
             SECTION("twoKeyList")
             {
-                path.m_nodes.push_back(schemaNode_{module_{"example-schema"}, list_{"twoKeyList"}});
+                path.m_nodes.emplace_back(module_{"example-schema"}, list_{"twoKeyList"});
                 SECTION("number")
                 {
                     key = "number";
@@ -488,13 +488,13 @@
 
             SECTION("_list")
             {
-                path.m_nodes.push_back(schemaNode_{module_{"example-schema"}, list_{"_list"}});
+                path.m_nodes.emplace_back(module_{"example-schema"}, list_{"_list"});
                 set = {"number"};
             }
 
             SECTION("twoKeyList")
             {
-                path.m_nodes.push_back(schemaNode_{module_{"example-schema"}, list_{"twoKeyList"}});
+                path.m_nodes.emplace_back(module_{"example-schema"}, list_{"twoKeyList"});
                 set = {"number", "name"};
             }
 
@@ -762,7 +762,7 @@
 
                 SECTION("example-schema:a")
                 {
-                    path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("a")));
+                    path.m_nodes.emplace_back(module_{"example-schema"}, container_("a"));
                     set = {
                         {boost::none, "a2"},
                         {boost::none, "leafa"},
@@ -772,13 +772,13 @@
 
                 SECTION("example-schema:ethernet")
                 {
-                    path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("ethernet")));
+                    path.m_nodes.emplace_back(module_{"example-schema"}, container_("ethernet"));
                     set = {{boost::none, "ip"}};
                 }
 
                 SECTION("second-schema:bla")
                 {
-                    path.m_nodes.push_back(schemaNode_(module_{"second-schema"}, container_("bla")));
+                    path.m_nodes.emplace_back(module_{"second-schema"}, container_("bla"));
                     set = {{boost::none, "bla2"}};
                 }
 
@@ -935,33 +935,33 @@
             yang::NodeTypes expected;
             SECTION("leafInt32")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("leafInt32")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("leafInt32"));
                 expected = yang::NodeTypes::Leaf;
             }
 
             SECTION("a")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("a")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, container_("a"));
                 expected = yang::NodeTypes::Container;
             }
 
             SECTION("a/a2/a3")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("a")));
-                path.m_nodes.push_back(schemaNode_(container_("a2")));
-                path.m_nodes.push_back(schemaNode_(container_("a3")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, container_("a"));
+                path.m_nodes.emplace_back(container_("a2"));
+                path.m_nodes.emplace_back(container_("a3"));
                 expected = yang::NodeTypes::PresenceContainer;
             }
 
             SECTION("_list")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, list_("_list")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, list_("_list"));
                 expected = yang::NodeTypes::List;
             }
 
             SECTION("subLeaf")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("subLeaf")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("subLeaf"));
                 expected = yang::NodeTypes::Leaf;
             }
 
@@ -973,18 +973,18 @@
             std::optional<std::string> expected;
             SECTION("leafInt32")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("leafInt32")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("leafInt32"));
                 expected = "A 32-bit integer leaf.";
             }
 
             SECTION("leafString")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("leafString")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("leafString"));
             }
 
             SECTION("numberOrString")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("numberOrString")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("numberOrString"));
                 expected = "Can be an int32 or a string.";
             }
 
@@ -1006,34 +1006,34 @@
             std::optional<std::string> expectedUnits;
             SECTION("length")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("length")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("length"));
                 expectedType.emplace<yang::Int32>();
                 expectedUnits = "m";
             }
 
             SECTION("wavelength")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("wavelength")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("wavelength"));
                 expectedType.emplace<yang::Decimal>();
                 expectedUnits = "nm";
             }
 
             SECTION("leafInt32")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("leafInt32")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("leafInt32"));
                 expectedType.emplace<yang::Int32>();
             }
 
             SECTION("duration")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("duration")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("duration"));
                 expectedType.emplace<yang::Int32>();
                 expectedUnits = "s";
             }
 
             SECTION("another-duration")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("another-duration")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("another-duration"));
                 expectedType.emplace<yang::Int32>();
                 expectedUnits = "vt";
             }
@@ -1047,27 +1047,27 @@
             yang::NodeTypes expected;
             SECTION("leafInt32")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, leaf_("leafInt32")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, leaf_("leafInt32"));
                 expected = yang::NodeTypes::Leaf;
             }
 
             SECTION("a")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("a")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, container_("a"));
                 expected = yang::NodeTypes::Container;
             }
 
             SECTION("a/a2/a3")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("a")));
-                path.m_nodes.push_back(schemaNode_(container_("a2")));
-                path.m_nodes.push_back(schemaNode_(container_("a3")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, container_("a"));
+                path.m_nodes.emplace_back(container_("a2"));
+                path.m_nodes.emplace_back(container_("a3"));
                 expected = yang::NodeTypes::PresenceContainer;
             }
 
             SECTION("_list")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, list_("_list")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, list_("_list"));
                 expected = yang::NodeTypes::List;
             }
 
@@ -1113,13 +1113,13 @@
 
             SECTION("example-schema:a/nevim")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("a")));
+                path.m_nodes.emplace_back(module_{"example-schema"}, container_("a"));
                 node.second = "nevim";
             }
 
             SECTION("modul:a/nevim")
             {
-                path.m_nodes.push_back(schemaNode_(module_{"modul"}, container_("a")));
+                path.m_nodes.emplace_back(module_{"modul"}, container_("a"));
                 node.second = "nevim";
             }
 
@@ -1128,8 +1128,8 @@
 
         SECTION("nodetype-specific methods called with different nodetypes")
         {
-            path.m_nodes.push_back(schemaNode_(module_{"example-schema"}, container_("a")));
-            path.m_nodes.push_back(schemaNode_(container_("a2")));
+            path.m_nodes.emplace_back(module_{"example-schema"}, container_("a"));
+            path.m_nodes.emplace_back(container_("a2"));
 
             REQUIRE(!ys.listHasKey(path, "chacha"));
         }