|
@@ -3,7 +3,7 @@
|
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2020-09-25
|
|
|
- * Changed: 2022-05-15
|
|
|
+ * Changed: 2022-05-20
|
|
|
*
|
|
|
* */
|
|
|
|
|
@@ -31,42 +31,42 @@ namespace
|
|
|
TEST_F(XmlNodeTest, addAttributeAfter)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
|
|
|
// add id after events
|
|
|
|
|
|
- ASSERT_TRUE(dialogNode.addAttributeAfter(std::make_shared<ls::std::io::XmlAttribute>("id"), "events"));
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ ASSERT_TRUE(dialogNode.addAttributeAfter(::std::make_shared<ls::std::io::XmlAttribute>("id"), "events"));
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
|
|
|
// add tasks after assets
|
|
|
|
|
|
- ASSERT_TRUE(dialogNode.addAttributeAfter(std::make_shared<ls::std::io::XmlAttribute>("tasks"), "assets"));
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ ASSERT_TRUE(dialogNode.addAttributeAfter(::std::make_shared<ls::std::io::XmlAttribute>("tasks"), "assets"));
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 3);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 3);
|
|
|
ASSERT_STREQ("tasks", currentAttribute->getName().c_str());
|
|
|
}
|
|
|
|
|
|
TEST_F(XmlNodeTest, addAttributeAfter_name_not_found)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- ASSERT_FALSE(dialogNode.addAttributeAfter(std::make_shared<ls::std::io::XmlAttribute>("id"), "events"));
|
|
|
+ ASSERT_FALSE(dialogNode.addAttributeAfter(::std::make_shared<ls::std::io::XmlAttribute>("id"), "events"));
|
|
|
}
|
|
|
|
|
|
TEST_F(XmlNodeTest, addAttributeAfter_no_reference)
|
|
@@ -92,7 +92,7 @@ namespace
|
|
|
EXPECT_THROW({
|
|
|
try
|
|
|
{
|
|
|
- dialogNode.addAttributeAfter(std::make_shared<ls::std::io::XmlAttribute>("id"), "");
|
|
|
+ dialogNode.addAttributeAfter(::std::make_shared<ls::std::io::XmlAttribute>("id"), "");
|
|
|
}
|
|
|
catch (const ls::std::core::IllegalArgumentException &_exception)
|
|
|
{
|
|
@@ -104,42 +104,42 @@ namespace
|
|
|
TEST_F(XmlNodeTest, addAttributeBefore)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
|
|
|
// add id before events
|
|
|
|
|
|
- ASSERT_TRUE(dialogNode.addAttributeBefore(std::make_shared<ls::std::io::XmlAttribute>("id"), "events"));
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ ASSERT_TRUE(dialogNode.addAttributeBefore(::std::make_shared<ls::std::io::XmlAttribute>("id"), "events"));
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
|
|
|
// add tasks before assets
|
|
|
|
|
|
- ASSERT_TRUE(dialogNode.addAttributeBefore(std::make_shared<ls::std::io::XmlAttribute>("tasks"), "assets"));
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ ASSERT_TRUE(dialogNode.addAttributeBefore(::std::make_shared<ls::std::io::XmlAttribute>("tasks"), "assets"));
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
ASSERT_STREQ("tasks", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 3);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 3);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
}
|
|
|
|
|
|
TEST_F(XmlNodeTest, addAttributeBefore_name_not_found)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- ASSERT_FALSE(dialogNode.addAttributeBefore(std::make_shared<ls::std::io::XmlAttribute>("tasks"), "assets"));
|
|
|
+ ASSERT_FALSE(dialogNode.addAttributeBefore(::std::make_shared<ls::std::io::XmlAttribute>("tasks"), "assets"));
|
|
|
}
|
|
|
|
|
|
TEST_F(XmlNodeTest, addAttributeBefore_no_reference)
|
|
@@ -165,7 +165,7 @@ namespace
|
|
|
EXPECT_THROW({
|
|
|
try
|
|
|
{
|
|
|
- dialogNode.addAttributeBefore(std::make_shared<ls::std::io::XmlAttribute>("id"), "");
|
|
|
+ dialogNode.addAttributeBefore(::std::make_shared<ls::std::io::XmlAttribute>("id"), "");
|
|
|
}
|
|
|
catch (const ls::std::core::IllegalArgumentException &_exception)
|
|
|
{
|
|
@@ -177,27 +177,27 @@ namespace
|
|
|
TEST_F(XmlNodeTest, addAttributeToBeginning)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
|
|
|
- dialogNode.addAttributeToBeginning(std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
+ dialogNode.addAttributeToBeginning(::std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
ASSERT_EQ(1, dialogNode.getAttributes().size());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
|
|
|
- dialogNode.addAttributeToBeginning(std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
+ dialogNode.addAttributeToBeginning(::std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
ASSERT_EQ(2, dialogNode.getAttributes().size());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
|
|
|
- dialogNode.addAttributeToBeginning(std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
+ dialogNode.addAttributeToBeginning(::std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
ASSERT_EQ(3, dialogNode.getAttributes().size());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
}
|
|
|
|
|
@@ -220,27 +220,27 @@ namespace
|
|
|
TEST_F(XmlNodeTest, addAttributeToEnd)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
ASSERT_EQ(1, dialogNode.getAttributes().size());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
ASSERT_EQ(2, dialogNode.getAttributes().size());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
ASSERT_EQ(3, dialogNode.getAttributes().size());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 2);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
}
|
|
|
|
|
@@ -263,50 +263,50 @@ namespace
|
|
|
TEST_F(XmlNodeTest, addChildAfter)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogs"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> dialogNodeA = std::make_shared<ls::std::io::XmlNode>("dialogNodeA");
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> dialogNodeB = std::make_shared<ls::std::io::XmlNode>("dialogNodeB");
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> dialogNodeC = std::make_shared<ls::std::io::XmlNode>("dialogNodeC");
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> dialogNodeD = std::make_shared<ls::std::io::XmlNode>("dialogNodeD");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> dialogNodeA = ::std::make_shared<ls::std::io::XmlNode>("dialogNodeA");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> dialogNodeB = ::std::make_shared<ls::std::io::XmlNode>("dialogNodeB");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> dialogNodeC = ::std::make_shared<ls::std::io::XmlNode>("dialogNodeC");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> dialogNodeD = ::std::make_shared<ls::std::io::XmlNode>("dialogNodeD");
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.addChildToEnd(dialogNodeB));
|
|
|
ASSERT_TRUE(dialogsNode.addChildToEnd(dialogNodeC));
|
|
|
ASSERT_EQ(2, dialogsNode.getChildren().size());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
|
|
|
// add A after B
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.addChildAfter(dialogNodeA, dialogNodeB));
|
|
|
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeA", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
|
|
|
// add D after C
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.addChildAfter(dialogNodeD, dialogNodeC));
|
|
|
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeA", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
ASSERT_STREQ("dialogNodeD", currentNode->getName().c_str());
|
|
|
}
|
|
|
|
|
|
TEST_F(XmlNodeTest, addChildAfter_no_search_node_available)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogs"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> newChild = std::make_shared<ls::std::io::XmlNode>("newChild");
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> searchNode = std::make_shared<ls::std::io::XmlNode>("searchNode");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> newChild = ::std::make_shared<ls::std::io::XmlNode>("newChild");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> searchNode = ::std::make_shared<ls::std::io::XmlNode>("searchNode");
|
|
|
|
|
|
ASSERT_FALSE(dialogsNode.addChildAfter(newChild, searchNode));
|
|
|
}
|
|
@@ -318,7 +318,7 @@ namespace
|
|
|
EXPECT_THROW({
|
|
|
try
|
|
|
{
|
|
|
- dialogNode.addChildAfter(nullptr, std::make_shared<ls::std::io::XmlNode>("children"));
|
|
|
+ dialogNode.addChildAfter(nullptr, ::std::make_shared<ls::std::io::XmlNode>("children"));
|
|
|
}
|
|
|
catch (const ls::std::core::IllegalArgumentException &_exception)
|
|
|
{
|
|
@@ -334,7 +334,7 @@ namespace
|
|
|
EXPECT_THROW({
|
|
|
try
|
|
|
{
|
|
|
- dialogNode.addChildAfter(std::make_shared<ls::std::io::XmlNode>("newChild"), nullptr);
|
|
|
+ dialogNode.addChildAfter(::std::make_shared<ls::std::io::XmlNode>("newChild"), nullptr);
|
|
|
}
|
|
|
catch (const ls::std::core::IllegalArgumentException &_exception)
|
|
|
{
|
|
@@ -346,50 +346,50 @@ namespace
|
|
|
TEST_F(XmlNodeTest, addChildBefore)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogs"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> dialogNodeA = std::make_shared<ls::std::io::XmlNode>("dialogNodeA");
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> dialogNodeB = std::make_shared<ls::std::io::XmlNode>("dialogNodeB");
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> dialogNodeC = std::make_shared<ls::std::io::XmlNode>("dialogNodeC");
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> dialogNodeD = std::make_shared<ls::std::io::XmlNode>("dialogNodeD");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> dialogNodeA = ::std::make_shared<ls::std::io::XmlNode>("dialogNodeA");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> dialogNodeB = ::std::make_shared<ls::std::io::XmlNode>("dialogNodeB");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> dialogNodeC = ::std::make_shared<ls::std::io::XmlNode>("dialogNodeC");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> dialogNodeD = ::std::make_shared<ls::std::io::XmlNode>("dialogNodeD");
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.addChildToEnd(dialogNodeB));
|
|
|
ASSERT_TRUE(dialogsNode.addChildToEnd(dialogNodeC));
|
|
|
ASSERT_EQ(2, dialogsNode.getChildren().size());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
|
|
|
// add A before C
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.addChildBefore(dialogNodeA, dialogNodeC));
|
|
|
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeA", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
|
|
|
// add D before B
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.addChildBefore(dialogNodeD, dialogNodeB));
|
|
|
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeD", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogNodeA", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
}
|
|
|
|
|
|
TEST_F(XmlNodeTest, addChildBefore_no_search_node_available)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogs"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> newChild = std::make_shared<ls::std::io::XmlNode>("newChild");
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> searchNode = std::make_shared<ls::std::io::XmlNode>("searchNode");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> newChild = ::std::make_shared<ls::std::io::XmlNode>("newChild");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> searchNode = ::std::make_shared<ls::std::io::XmlNode>("searchNode");
|
|
|
|
|
|
ASSERT_FALSE(dialogsNode.addChildBefore(newChild, searchNode));
|
|
|
}
|
|
@@ -401,7 +401,7 @@ namespace
|
|
|
EXPECT_THROW({
|
|
|
try
|
|
|
{
|
|
|
- dialogNode.addChildBefore(nullptr, std::make_shared<ls::std::io::XmlNode>("children"));
|
|
|
+ dialogNode.addChildBefore(nullptr, ::std::make_shared<ls::std::io::XmlNode>("children"));
|
|
|
}
|
|
|
catch (const ls::std::core::IllegalArgumentException &_exception)
|
|
|
{
|
|
@@ -417,7 +417,7 @@ namespace
|
|
|
EXPECT_THROW({
|
|
|
try
|
|
|
{
|
|
|
- dialogNode.addChildBefore(std::make_shared<ls::std::io::XmlNode>("newChild"), nullptr);
|
|
|
+ dialogNode.addChildBefore(::std::make_shared<ls::std::io::XmlNode>("newChild"), nullptr);
|
|
|
}
|
|
|
catch (const ls::std::core::IllegalArgumentException &_exception)
|
|
|
{
|
|
@@ -429,7 +429,7 @@ namespace
|
|
|
TEST_F(XmlNodeTest, addChildToBeginning)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogs"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
|
|
|
ls::std::io::XmlNode dialogNodeA{"dialogNodeA"};
|
|
|
ls::std::io::XmlNode dialogNodeB{"dialogNodeB"};
|
|
@@ -440,31 +440,31 @@ namespace
|
|
|
|
|
|
// adding C
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToBeginning(std::make_shared<ls::std::io::XmlNode>(dialogNodeC)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToBeginning(::std::make_shared<ls::std::io::XmlNode>(dialogNodeC)));
|
|
|
ASSERT_TRUE(!dialogsNode.getChildren().empty());
|
|
|
ASSERT_EQ(1, dialogsNode.getChildren().size());
|
|
|
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
|
|
|
// adding B
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToBeginning(std::make_shared<ls::std::io::XmlNode>(dialogNodeB)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToBeginning(::std::make_shared<ls::std::io::XmlNode>(dialogNodeB)));
|
|
|
ASSERT_EQ(2, dialogsNode.getChildren().size());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
|
|
|
// adding A
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToBeginning(std::make_shared<ls::std::io::XmlNode>(dialogNodeA)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToBeginning(::std::make_shared<ls::std::io::XmlNode>(dialogNodeA)));
|
|
|
ASSERT_EQ(3, dialogsNode.getChildren().size());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeA", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
}
|
|
|
|
|
@@ -487,7 +487,7 @@ namespace
|
|
|
TEST_F(XmlNodeTest, addChildToEnd)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogs"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
|
|
|
ls::std::io::XmlNode dialogNodeA{"dialogNodeA"};
|
|
|
ls::std::io::XmlNode dialogNodeB{"dialogNodeB"};
|
|
@@ -498,31 +498,31 @@ namespace
|
|
|
|
|
|
// adding C
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>(dialogNodeC)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>(dialogNodeC)));
|
|
|
ASSERT_TRUE(!dialogsNode.getChildren().empty());
|
|
|
ASSERT_EQ(1, dialogsNode.getChildren().size());
|
|
|
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
|
|
|
// adding B
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>(dialogNodeB)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>(dialogNodeB)));
|
|
|
ASSERT_EQ(2, dialogsNode.getChildren().size());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
|
|
|
// adding A
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>(dialogNodeA)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>(dialogNodeA)));
|
|
|
ASSERT_EQ(3, dialogsNode.getChildren().size());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogNodeC", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogNodeB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogNodeA", currentNode->getName().c_str());
|
|
|
}
|
|
|
|
|
@@ -573,11 +573,11 @@ namespace
|
|
|
|
|
|
// preparation
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>(dialogNode)));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>(otherNode)));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>(otherNode)));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>(dialogNode)));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>(otherNode)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>(dialogNode)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>(otherNode)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>(otherNode)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>(dialogNode)));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>(otherNode)));
|
|
|
|
|
|
// check
|
|
|
|
|
@@ -602,9 +602,9 @@ namespace
|
|
|
TEST_F(XmlNodeTest, hasAttribute)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialogNode"};
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
|
|
|
ASSERT_TRUE(dialogNode.hasAttribute("id"));
|
|
|
ASSERT_TRUE(dialogNode.hasAttribute("events"));
|
|
@@ -636,9 +636,9 @@ namespace
|
|
|
TEST_F(XmlNodeTest, hasChild)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogsNode"};
|
|
|
- dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogA"));
|
|
|
- dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogB"));
|
|
|
- dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogC"));
|
|
|
+ dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogA"));
|
|
|
+ dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogB"));
|
|
|
+ dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogC"));
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.hasChild("dialogA"));
|
|
|
ASSERT_TRUE(dialogsNode.hasChild("dialogB"));
|
|
@@ -670,10 +670,10 @@ namespace
|
|
|
TEST_F(XmlNodeTest, hasChildV2)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogsNode"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> searchNode = std::make_shared<ls::std::io::XmlNode>("dialogB");
|
|
|
- dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogA"));
|
|
|
+ std::shared_ptr<ls::std::io::XmlNode> searchNode = ::std::make_shared<ls::std::io::XmlNode>("dialogB");
|
|
|
+ dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogA"));
|
|
|
dialogsNode.addChildToEnd(searchNode);
|
|
|
- dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogC"));
|
|
|
+ dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogC"));
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.hasChild(searchNode));
|
|
|
}
|
|
@@ -681,7 +681,7 @@ namespace
|
|
|
TEST_F(XmlNodeTest, hasChildV2_child_not_available)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogsNode"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> searchNode = std::make_shared<ls::std::io::XmlNode>("dialogB");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> searchNode = ::std::make_shared<ls::std::io::XmlNode>("dialogB");
|
|
|
|
|
|
ASSERT_FALSE(dialogsNode.hasChild(searchNode));
|
|
|
}
|
|
@@ -689,7 +689,7 @@ namespace
|
|
|
TEST_F(XmlNodeTest, hasChildV2_no_child_reference)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> searchNode{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> searchNode{};
|
|
|
|
|
|
EXPECT_THROW({
|
|
|
try
|
|
@@ -706,10 +706,10 @@ namespace
|
|
|
TEST_F(XmlNodeTest, removeFirstAttribute)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
|
|
|
ASSERT_TRUE(!dialogNode.getAttributes().empty());
|
|
|
ASSERT_EQ(3, dialogNode.getAttributes().size());
|
|
@@ -717,9 +717,9 @@ namespace
|
|
|
ASSERT_TRUE(dialogNode.removeFirstAttribute());
|
|
|
ASSERT_EQ(2, dialogNode.getAttributes().size());
|
|
|
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("assets", currentAttribute->getName().c_str());
|
|
|
}
|
|
|
|
|
@@ -732,10 +732,10 @@ namespace
|
|
|
TEST_F(XmlNodeTest, removeLastAttribute)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogNode{"dialog"};
|
|
|
- std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
- dialogNode.addAttributeToEnd(std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlAttribute> currentAttribute{};
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("id"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("events"));
|
|
|
+ dialogNode.addAttributeToEnd(::std::make_shared<ls::std::io::XmlAttribute>("assets"));
|
|
|
|
|
|
ASSERT_TRUE(!dialogNode.getAttributes().empty());
|
|
|
ASSERT_EQ(3, dialogNode.getAttributes().size());
|
|
@@ -743,9 +743,9 @@ namespace
|
|
|
ASSERT_TRUE(dialogNode.removeLastAttribute());
|
|
|
ASSERT_EQ(2, dialogNode.getAttributes().size());
|
|
|
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 0);
|
|
|
ASSERT_STREQ("id", currentAttribute->getName().c_str());
|
|
|
- currentAttribute = *std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
+ currentAttribute = *::std::next(dialogNode.getAttributes().begin(), 1);
|
|
|
ASSERT_STREQ("events", currentAttribute->getName().c_str());
|
|
|
}
|
|
|
|
|
@@ -758,38 +758,38 @@ namespace
|
|
|
TEST_F(XmlNodeTest, removeFirstChild)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogs"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
|
|
|
// preparation
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogA")));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogB")));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogC")));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("additionalInfo")));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("event")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogA")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogB")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogC")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("additionalInfo")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("event")));
|
|
|
|
|
|
ASSERT_EQ(5, dialogsNode.getChildren().size());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogA", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogC", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
ASSERT_STREQ("additionalInfo", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 4);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 4);
|
|
|
ASSERT_STREQ("event", currentNode->getName().c_str());
|
|
|
|
|
|
// check
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.removeFirstChild());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogC", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("additionalInfo", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
ASSERT_STREQ("event", currentNode->getName().c_str());
|
|
|
}
|
|
|
|
|
@@ -802,38 +802,38 @@ namespace
|
|
|
TEST_F(XmlNodeTest, removeLastChild)
|
|
|
{
|
|
|
ls::std::io::XmlNode dialogsNode{"dialogs"};
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> currentNode{};
|
|
|
|
|
|
// preparation
|
|
|
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogA")));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogB")));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("dialogC")));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("additionalInfo")));
|
|
|
- ASSERT_TRUE(dialogsNode.addChildToEnd(std::make_shared<ls::std::io::XmlNode>("event")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogA")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogB")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("dialogC")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("additionalInfo")));
|
|
|
+ ASSERT_TRUE(dialogsNode.addChildToEnd(::std::make_shared<ls::std::io::XmlNode>("event")));
|
|
|
|
|
|
ASSERT_EQ(5, dialogsNode.getChildren().size());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogA", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogC", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
ASSERT_STREQ("additionalInfo", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 4);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 4);
|
|
|
ASSERT_STREQ("event", currentNode->getName().c_str());
|
|
|
|
|
|
// check
|
|
|
|
|
|
ASSERT_TRUE(dialogsNode.removeLastChild());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 0);
|
|
|
ASSERT_STREQ("dialogA", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 1);
|
|
|
ASSERT_STREQ("dialogB", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 2);
|
|
|
ASSERT_STREQ("dialogC", currentNode->getName().c_str());
|
|
|
- currentNode = *std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
+ currentNode = *::std::next(dialogsNode.getChildren().begin(), 3);
|
|
|
ASSERT_STREQ("additionalInfo", currentNode->getName().c_str());
|
|
|
}
|
|
|
|
|
@@ -894,15 +894,15 @@ namespace
|
|
|
TEST_F(XmlNodeTest, toXml)
|
|
|
{
|
|
|
auto root = ls_std_io_test::TestDataFactory::createXmlContent();
|
|
|
- std::string xmlContent = root->toXml();
|
|
|
+ ::std::string xmlContent = root->toXml();
|
|
|
|
|
|
ASSERT_TRUE(!xmlContent.empty());
|
|
|
}
|
|
|
|
|
|
TEST_F(XmlNodeTest, toXml_no_value)
|
|
|
{
|
|
|
- std::shared_ptr<ls::std::io::XmlNode> singleLineElement = std::make_shared<ls::std::io::XmlNode>("info");
|
|
|
- std::shared_ptr<ls::std::io::XmlAttribute> attribute = std::make_shared<ls::std::io::XmlAttribute>("id");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlNode> singleLineElement = ::std::make_shared<ls::std::io::XmlNode>("info");
|
|
|
+ ::std::shared_ptr<ls::std::io::XmlAttribute> attribute = ::std::make_shared<ls::std::io::XmlAttribute>("id");
|
|
|
attribute->setValue("important");
|
|
|
singleLineElement->addAttributeToEnd(attribute);
|
|
|
|