GCC Code Coverage Report


Directory: src/gate/
File: src/gate/encode/tests/gateencode_cpp_test/test_xml.cpp
Date: 2025-09-14 13:10:38
Exec Total Coverage
Lines: 10 10 100.0%
Functions: 6 6 100.0%
Branches: 14 34 41.2%

Line Branch Exec Source
1 #include "gate/tests.hpp"
2 #include "gate/encode/xml.hpp"
3
4 using namespace gate;
5 using namespace gate::enc;
6
7
2/7
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
6 GATEXX_TEST_UNIT(XmlParse)
8 {
9 static char const* const xml_text = "<root><item attr=\"value\"><data>Hello</data></item></root>";
10
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 XmlDoc doc(xml_text);
11 2 }
12
13
14
2/7
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
6 GATEXX_TEST_UNIT(XmlCreate)
15 {
16
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 XmlDoc doc;
17
18
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 XmlNode root(XmlNode::Type_Element, "root");
19 //doc.addAttribute(root, "a", "b");
20 //doc.removeAttribute(root, "a");
21
22
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 XmlNode item(XmlNode::Type_Element, "item");
23 //doc.addAttribute(item, "attrib", "value");
24
25
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 XmlNode data(XmlNode::Type_Element, "data");
26 //doc.setContent(data, "Hello World");
27
28 //doc.addNode(item, data);
29 //doc.addNode(root, item);
30
31
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String text = root.toString();
32 2 }
33