aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests/xml-utils-selftests.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-09-16 14:19:31 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-09-16 14:19:31 +0200
commit5e1875543df7413d3cbc3831390445e347064b75 (patch)
tree215e09584279387448ae183671588f0bac07a1f6 /gdb/unittests/xml-utils-selftests.c
parentc3d7b541fa920e6ecb0f06ffe1e0e3f070fa295d (diff)
downloadgdb-5e1875543df7413d3cbc3831390445e347064b75.zip
gdb-5e1875543df7413d3cbc3831390445e347064b75.tar.gz
gdb-5e1875543df7413d3cbc3831390445e347064b75.tar.bz2
Make xml_escape_text return an std::string
This is a simple replacement, it allows removing some manual free'ing in the callers. gdb/ChangeLog: * common/buffer.c (buffer_xml_printf): Adjust. * common/xml-utils.c (xml_escape_text): Change return type to std::string, update code accordingly. * common/xml-utils.h (xml_escape_text): Change return type to std::string. * rs6000-aix-tdep.c (rs6000_aix_shared_library_to_xml): Adjust. * windows-tdep.c (windows_xfer_shared_library): Adjust. * unittests/xml-utils-selftests.c (test_xml_escape_text): Adjust. gdb/gdbserver/ChangeLog: * linux-low.c (linux_qxfer_libraries_svr4): Adjust to change of return type of xml_escape_text. * server.c (emit_dll_description): Likewise.
Diffstat (limited to 'gdb/unittests/xml-utils-selftests.c')
-rw-r--r--gdb/unittests/xml-utils-selftests.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/unittests/xml-utils-selftests.c b/gdb/unittests/xml-utils-selftests.c
index 21b506a..e4ab483 100644
--- a/gdb/unittests/xml-utils-selftests.c
+++ b/gdb/unittests/xml-utils-selftests.c
@@ -28,11 +28,9 @@ static void test_xml_escape_text ()
{
const char *input = "<this isn't=\"xml\"> &";
const char *expected_output = "&lt;this isn&apos;t=&quot;xml&quot;&gt; &amp;";
- char *actual_output = xml_escape_text (input);
+ std::string actual_output = xml_escape_text (input);
- SELF_CHECK (strcmp (actual_output, expected_output) == 0);
-
- xfree (actual_output);
+ SELF_CHECK (actual_output == expected_output);
}
}