From 260dc0e77e822c929860f50d5c1e9e0239c223d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=BB=A3=E7=A0=812016?= Date: Wed, 1 Feb 2023 12:53:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_tinyxml2_edit_node.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/test_tinyxml2_edit_node.cpp diff --git a/test/test_tinyxml2_edit_node.cpp b/test/test_tinyxml2_edit_node.cpp new file mode 100644 index 0000000..2c39728 --- /dev/null +++ b/test/test_tinyxml2_edit_node.cpp @@ -0,0 +1,25 @@ +#include +#include + +#include "doctest/doctest.h" +#include "tinyxml2.h" +#include "spdlog/spdlog.h" +#include "khl_xml_config/khl_xml_config.hpp" + +TEST_CASE("tinyxml2_edit_node") +{ + std::string simpleXmlPath; + + tinyxml2::XMLDocument doc; + tinyxml2::XMLError xmlError; + + /** + * 查找节点 + */ + SUBCASE("add_node") + { + simpleXmlPath = getXmlPath("/data/simple.xml"); + xmlError = doc.LoadFile(simpleXmlPath.c_str()); + CHECK(tinyxml2::XMLError::XML_SUCCESS == xmlError); + } +} \ No newline at end of file -- GitLab