diff options
Diffstat (limited to 'gdb/unittests/xml-utils-selftests.c')
-rw-r--r-- | gdb/unittests/xml-utils-selftests.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/unittests/xml-utils-selftests.c b/gdb/unittests/xml-utils-selftests.c index 2457494..1412773 100644 --- a/gdb/unittests/xml-utils-selftests.c +++ b/gdb/unittests/xml-utils-selftests.c @@ -33,6 +33,18 @@ static void test_xml_escape_text () SELF_CHECK (actual_output == expected_output); } +static void test_xml_escape_text_append () +{ + /* Make sure that we do indeed append. */ + std::string actual_output = "foo<xml>"; + const char *input = "<this isn't=\"xml\"> &"; + const char *expected_output + = "foo<xml><this isn't="xml"> &"; + xml_escape_text_append (&actual_output, input); + + SELF_CHECK (actual_output == expected_output); +} + } } @@ -41,4 +53,6 @@ _initialize_xml_utils () { selftests::register_test ("xml_escape_text", selftests::xml_utils::test_xml_escape_text); + selftests::register_test ("xml_escape_text_append", + selftests::xml_utils::test_xml_escape_text_append); } |