mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
New testcases.
2002-05-18 Matthias Clasen <maclas@gmx.de> * tests/markups/fail-36.gmarkup: * tests/markups/fail-35.gmarkup: * tests/markups/valid-8.gmarkup: * tests/markups/valid-7.gmarkup: * tests/markups/valid-6.gmarkup: * tests/markups/valid-5.gmarkup: New testcases. * tests/markup-test.c (passthrough_handler): (text_handler): Don't ignore the text_len parameter. * glib/gmarkup.c (find_current_text_end): Don't hang on embedded nuls. (#81977) (g_markup_parse_context_parse): Fix passthrough handling to correctly skip processing instructions, comments, doctype declarations and CDATA marked sections. (#81977)
This commit is contained in:
committed by
Matthias Clasen
parent
ed8f19b4c6
commit
60f59976d9
@@ -61,7 +61,7 @@ text_handler (GMarkupParseContext *context,
|
||||
GError **error)
|
||||
{
|
||||
indent (0);
|
||||
printf ("TEXT '%s'\n", text);
|
||||
printf ("TEXT '%.*s'\n", (int)text_len, text);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ passthrough_handler (GMarkupParseContext *context,
|
||||
{
|
||||
indent (0);
|
||||
|
||||
printf ("PASS '%s'\n", passthrough_text);
|
||||
printf ("PASS '%.*s'\n", (int)text_len, passthrough_text);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -200,3 +200,4 @@ main (int argc,
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
1
tests/markups/fail-35.gmarkup
Normal file
1
tests/markups/fail-35.gmarkup
Normal file
@@ -0,0 +1 @@
|
||||
<foo>gedit&</foo>
|
BIN
tests/markups/fail-36.gmarkup
Normal file
BIN
tests/markups/fail-36.gmarkup
Normal file
Binary file not shown.
2
tests/markups/valid-5.gmarkup
Normal file
2
tests/markups/valid-5.gmarkup
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" ?>
|
||||
<foo></foo>
|
4
tests/markups/valid-6.gmarkup
Normal file
4
tests/markups/valid-6.gmarkup
Normal file
@@ -0,0 +1,4 @@
|
||||
<!DOCTYPE foo "foo" [
|
||||
<!ELEMENT foo ANY >
|
||||
]>
|
||||
<foo></foo>
|
2
tests/markups/valid-7.gmarkup
Normal file
2
tests/markups/valid-7.gmarkup
Normal file
@@ -0,0 +1,2 @@
|
||||
<!-- a comment -->
|
||||
<foo></foo>
|
1
tests/markups/valid-8.gmarkup
Normal file
1
tests/markups/valid-8.gmarkup
Normal file
@@ -0,0 +1 @@
|
||||
<foo><![CDATA[ some <<<<>>>> CDATA ]]></foo>
|
@@ -9,6 +9,9 @@ fail ()
|
||||
for I in $srcdir/markups/fail-*.gmarkup; do
|
||||
echo "Parsing $I, should fail"
|
||||
./markup-test $I > /dev/null && fail "failed to generate error on $I"
|
||||
if test "$?" != "1"; then
|
||||
fail "unexpected error on $I"
|
||||
fi
|
||||
done
|
||||
|
||||
for I in $srcdir/markups/valid-*.gmarkup; do
|
||||
|
Reference in New Issue
Block a user