diff options
author | Robert Brady <rwb197@ecs.soton.ac.uk> | 1999-08-06 22:25:09 +0800 |
---|---|---|
committer | Robert Brady <rbrady@src.gnome.org> | 1999-08-06 22:25:09 +0800 |
commit | 2bbd6e4180c90540f5be5c87736099229d234d60 (patch) | |
tree | 7b10b6c9625616409130d0ce734205a562e66b14 /tests | |
parent | cf2f1c428f9a75323318f04c66c7e1999ad65f62 (diff) | |
download | gsoc2013-evolution-2bbd6e4180c90540f5be5c87736099229d234d60.tar.gz gsoc2013-evolution-2bbd6e4180c90540f5be5c87736099229d234d60.tar.zst gsoc2013-evolution-2bbd6e4180c90540f5be5c87736099229d234d60.zip |
test for RFC2047 decoder.
1998-08-06 Robert Brady <rwb197@ecs.soton.ac.uk>
* tests/test5.c: test for RFC2047 decoder.
* camel/gmime-rfc2047.c: Improved RFC2047 decoder.
svn path=/trunk/; revision=1088
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.cvsignore | 5 | ||||
-rw-r--r-- | tests/test5.c | 60 |
2 files changed, 65 insertions, 0 deletions
diff --git a/tests/.cvsignore b/tests/.cvsignore index 8cb5c0556b..7232b242dc 100644 --- a/tests/.cvsignore +++ b/tests/.cvsignore @@ -1,3 +1,8 @@ +test1 +test2 +test3 +test4 +test5 Makefile.in Makefile .deps diff --git a/tests/test5.c b/tests/test5.c new file mode 100644 index 0000000000..2f47fda418 --- /dev/null +++ b/tests/test5.c @@ -0,0 +1,60 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* test for the RFC 2047 decoder */ + +#include <string.h> +#include <unicode.h> + +#include "gmime-utils.h" +#include "stdio.h" +#include "camel-log.h" +#include "camel-mime-message.h" +#include "camel-mime-part.h" +#include "camel-stream.h" +#include "camel-stream-fs.h" +#include "camel.h" +#include "gmime-rfc2047.h" + +#define TERMINAL_CHARSET "UTF-8" + +/* + * Info on many unicode issues, including, utf-8 xterms from : + * + * http://www.cl.cam.ac.uk/~mgk/unicode.html + * + */ + +const char *tests[] = +{ +/* these strings come from RFC 2047. Ought to add a few torture cases here. */ + "=?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>", + "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>", + "=?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>", + "=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=", + "=?ISO-8859-1?Q?Olle_J=E4rnefors?= <ojarnef@admin.kth.se>", + "=?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <paf@nada.kth.se>", + "Nathaniel Borenstein <nsb@thumper.bellcore.com> (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)", + "", + "(=?ISO-8859-1?Q?a?=)", /* should be displayed as (a) */ + "(=?ISO-8859-1?Q?a?= b)", /* (a b) */ + "(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)", /* (ab) */ + "(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)", /* (ab) */ + "(=?ISO-8859-1?Q?a?= \n=?ISO-8859-1?Q?b?=)", /* (ab) */ + "(=?ISO-8859-1?Q?a_b?=)", /* (a b) */ + "(=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)", /* (ab) */ + NULL +}; + + +int +main (int argc, char**argv) +{ + const char **b = tests; + while (*b) { + printf("%s\n", gmime_rfc2047_decode(*b, TERMINAL_CHARSET)); + b++; + } + + return 0; + +} |