Skip to content

[xml] Add unit tests for TXMLEngine and TXMLFile - #23900

Closed
ravindra-RKB wants to merge 1 commit into
root-project:masterfrom
ravindra-RKB:feature-xml-unittests
Closed

ravindra-RKB wants to merge 1 commit into
root-project:masterfrom
ravindra-RKB:feature-xml-unittests

Conversation

@ravindra-RKB

Copy link
Copy Markdown
Contributor

This PR introduces unit tests for the XMLIO module under io/xml/test/, which currently lacks dedicated Google Test coverage.

Changes:

  • TXMLEngine unit tests:
    • Tests DOM construction, nested elements, string/integer attributes, and in-memory serialization/parsing (SaveSingleNode, ParseString).
    • Tests XML document creation, file output (SaveDoc), and file parsing (ParseFile).
  • TXMLFile unit tests:
    • Tests writing and reading ROOT objects (TH1I, TObjString, TNamed) to/from XML files.
    • Tests directory hierarchies (mkdir, cd), subfolder navigation, and key retrieval.
    • Uses ROOT::TestSupport::FileRaii and std::unique_ptr to ensure clean resource management without leaving files on disk.
  • Registers the test directory in io/xml/CMakeLists.txt and adds the gtest target in io/xml/test/CMakeLists.txt.

Checklist:

  • Tested changes locally
  • Follows ROOT coding style and formatted with clang-format
  • Minimal and focused changes

@linev

linev commented Oct 30, 2026

Copy link
Copy Markdown
Member

Not needed.
There are several tests for TXMLEngine and TXMLFile in
https://github.com/root-project/root/tree/master/roottest/root/io/xml

@linev linev closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants