[vlc-devel] commit: Test cases for convert_xml_special_chars ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Jul 15 20:37:12 CEST 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 15 21:36:23 2009 +0300| [89d3524d62e93343ff6d5e963ecaeb042c143f4b] | committer: Rémi Denis-Courmont
Test cases for convert_xml_special_chars
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=89d3524d62e93343ff6d5e963ecaeb042c143f4b
---
src/test/xmlent.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/test/xmlent.c b/src/test/xmlent.c
index acba718..e5bc4a6 100644
--- a/src/test/xmlent.c
+++ b/src/test/xmlent.c
@@ -44,6 +44,21 @@ static void decode (const char *in, const char *out)
}
}
+static void encode (const char *in, const char *out)
+{
+ char *buf;
+
+ printf ("\"%s\" -> \"%s\" ?\n", in, out);
+ buf = convert_xml_special_chars (in);
+
+ if (strcmp (buf, out))
+ {
+ printf (" ERROR: got \"%s\"\n", buf);
+ exit (2);
+ }
+ free (buf);
+}
+
int main (void)
{
(void)setvbuf (stdout, NULL, _IONBF, 0);
@@ -59,5 +74,8 @@ int main (void)
decode ("&<\"'", "&<\"'");
decode ("&oelig", "&oelig");
+ encode ("", "");
+ encode ("a'àc\"çe&én<ño>ö1:", "a'àc"çe&én<ño>ö1:");
+
return 0;
}
More information about the vlc-devel
mailing list