MCPcopy Create free account
hub / github.com/acl-dev/acl / test

Function test

lib_acl_cpp/samples/xml/xml2/xml.cpp:8–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace std;
7
8static void test()
9{
10 acl::string buf;
11 acl::xml1 xml;
12 acl::xml_node& root = xml.get_root();
13 acl::xml_node& server = xml.create_node("server");
14 root.add_child(server);
15
16 acl::xml_node& proc1 = xml.create_node("proc");
17 server.add_child(proc1);
18 proc1.add_child("pid", false, "1111");
19 proc1.add_child("conns", false, "111");
20 proc1.add_child("load", false, "0.5");
21
22 acl::xml_node& proc2 = xml.create_node("proc");
23 server.add_child(proc2);
24 proc2.add_child("pid", false, "2111");
25 proc2.add_child("conns", false, "211");
26 proc2.add_child("load", false, "2.5");
27
28 printf("-------------- after build_xml -------------------\r\n");
29 xml.build_xml(buf);
30 printf("%s\r\n", buf.c_str());
31
32 printf("Enter any key to continue ...\r\n");
33 getchar();
34
35 proc1.detach();
36 printf("--------------- after detach proc1 --------------\r\n");
37 size_t len;
38 printf("%s\r\n", xml.to_string(&len));
39
40 printf("Enter any key to continue ...\r\n");
41 getchar();
42
43 proc2.detach();
44 printf("--------------- after detach proc2 --------------\r\n");
45 printf("%s\r\n", xml.to_string(&len));
46
47 printf("Enter any key to continue ...\r\n");
48 getchar();
49}
50
51static void print_attrs(acl::xml_node& node)
52{

Callers 1

mainFunction · 0.70

Calls 5

create_nodeMethod · 0.45
build_xmlMethod · 0.45
c_strMethod · 0.45
detachMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…