aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@src.gnome.org>2002-09-26 07:25:05 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-09-26 07:25:05 +0800
commitcf4ca10f51a0809ba81a86ce6916f6f32a5ee840 (patch)
treef3287a6788dec08c66bf6c7d4aed125e8d603975
parent20c4b44474062abd353bc10966b5f7f4026d1336 (diff)
downloadgsoc2013-evolution-cf4ca10f51a0809ba81a86ce6916f6f32a5ee840.tar
gsoc2013-evolution-cf4ca10f51a0809ba81a86ce6916f6f32a5ee840.tar.gz
gsoc2013-evolution-cf4ca10f51a0809ba81a86ce6916f6f32a5ee840.tar.bz2
gsoc2013-evolution-cf4ca10f51a0809ba81a86ce6916f6f32a5ee840.tar.lz
gsoc2013-evolution-cf4ca10f51a0809ba81a86ce6916f6f32a5ee840.tar.xz
gsoc2013-evolution-cf4ca10f51a0809ba81a86ce6916f6f32a5ee840.tar.zst
gsoc2013-evolution-cf4ca10f51a0809ba81a86ce6916f6f32a5ee840.zip
Added a test suite for camel-mime-filter-charset and added a few test cases for it. input charset files should be in the form "charset-%s.%d.in" where %s is the charset name that the file is in and %d is just some number as in a sequence id. Mostly just so we can have multiple test files per charset
svn path=/trunk/; revision=18227
-rw-r--r--camel/tests/mime-filter/.cvsignore2
-rw-r--r--camel/tests/mime-filter/Makefile.am15
-rw-r--r--camel/tests/mime-filter/charset-gb2312.0.in448
-rw-r--r--camel/tests/mime-filter/charset-gb2312.0.out448
-rw-r--r--camel/tests/mime-filter/charset-iso-2022-jp.0.in5
-rw-r--r--camel/tests/mime-filter/charset-iso-2022-jp.0.out5
-rw-r--r--camel/tests/mime-filter/test-charset.c140
-rw-r--r--camel/tests/mime-filter/test-crlf.c7
8 files changed, 1059 insertions, 11 deletions
diff --git a/camel/tests/mime-filter/.cvsignore b/camel/tests/mime-filter/.cvsignore
index c1f16ee7d4..f8d627b581 100644
--- a/camel/tests/mime-filter/.cvsignore
+++ b/camel/tests/mime-filter/.cvsignore
@@ -4,5 +4,5 @@ Makefile.in
.libs
*.lo
*.la
-test-stripheader
test-crlf
+test-charset \ No newline at end of file
diff --git a/camel/tests/mime-filter/Makefile.am b/camel/tests/mime-filter/Makefile.am
index bceee243eb..f2f686d593 100644
--- a/camel/tests/mime-filter/Makefile.am
+++ b/camel/tests/mime-filter/Makefile.am
@@ -19,14 +19,19 @@ LDADD = \
$(INTLLIBS) \
$(EVOLUTION_MAIL_LIBS)
-EXTRA_DIST = \
- crlf-1.in \
- crlf-1.out
+EXTRA_DIST = \
+ crlf-1.in \
+ crlf-1.out \
+ charset-iso-2022-jp.0.in \
+ charset-iso-2022-jp.0.out \
+ charset-gb2312.0.in \
+ charset-gb2312.0.out
check_PROGRAMS = \
- test-crlf
+ test-crlf \
+ test-charset
-TESTS = test-crlf
+TESTS = test-crlf test-charset
diff --git a/camel/tests/mime-filter/charset-gb2312.0.in b/camel/tests/mime-filter/charset-gb2312.0.in
new file mode 100644
index 0000000000..82520ac916
--- /dev/null
+++ b/camel/tests/mime-filter/charset-gb2312.0.in
@@ -0,0 +1,448 @@
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
+<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<title>һվʽ��ó�ס���漰��ƹ���ϵͳ An all-in-one solution for trading, inventory, accounting management</title>
+
+
+<style>
+<!--
+#fps0 {font-style: normal}
+#fps1 {background-color: #339933}
+#fps2 {font-family:times new roman;font-size:24pt;color:#0066ff;}
+#fps3 {font-family:times new roman;font-size:18pt;color:#0066ff;}
+#fps4 {font-family:SimSun;font-size:14pt}
+#fps5 {color:#0066ff;font-weight:bold;}
+#fps6 {font-size:10pt;}
+#fps7 {color:#ffffff;}
+#fps8 {font-family:times new roman;color:#ffffff;font-weight:bold;}
+#fps9 {font-family:times new roman;font-size:10pt;}
+#fps10 {font-size:10pt;color:#0066ff;}
+-->
+</style>
+
+</head>
+
+<body topmargin="0" leftmargin="10" bgcolor="#FFFFFF" >
+ <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 id=AutoNumber1 height=233>
+ <tr valign=top>
+ <td height=165>
+ <p align=justify>
+
+
+ <em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><font color=#FF0000>
+ <strong><font size=2>&nbsp;<br>
+ </font></strong></font><font face=SimSun size=2>��һվʽ��ó�ס���漰��ƹ���ϵͳ�����������ܶ���ʼ���������롢���ݴ��������౨�ۡ���Ʊ����֡��ռ��ʡ���Ʊ��������������ļ�������������������Ч�ع���ó�ס���漰�������</font></td>
+ <td height=165>
+ <p align=justify>
+
+
+ <em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><font size=2><!----><font color=#FF0000>
+ <strong>&nbsp;<br>
+ <font face="Times New Roman">What's the most annoying part during your
+ work? </font>
+ </strong></font><font face="Times New Roman">Endless repetitive data
+ entry, calculation and paper work on quotation, invoice, inventory
+ management, daily voucher, journal and reporting? Once you have installed<span id=fps5>
+ TRADEdotNET</span>,<span id=fps5> </span>all of these
+ annoying work will never appear in your office again!<span id=fps5><br>
+ TRADEdotNET</span> is an all-in-one solution for trading, inventory,
+ accounting management. In the <span id=fps5>TRADEdotNET</span>&nbsp;
+ environment, all data can be continuously retrieved and reused. This will
+ help you for minimizing time consumed on data entry and enhancing
+ efficiency.</font></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=68><em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span>�ֱ���<span lang=zh-tw>��</span>��ϵͳ��ɣ�ó�׶�������<font face=SimSun>�����</font>���������ϵͳ</td>
+ <td height=68><em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><font face="Times New Roman">Containing Trading Management
+ Module, Inventory Management Module and Accounting Management Module.</font></td>
+ </tr>
+ </table>
+ <p align=center><span id=fps6>
+ <img border=0 src=Flow2.gif width=600 height=420></span></p>
+ <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 id=AutoNumber2 height=15>
+ <tr valign=top>
+ <td height=129>
+ <em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><span id=fps6>���ŵ�</span><span lang=zh-tw><!----><span id=fps6>��</span></span><span id=fps6><br>
+ </span>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;����ϵͳ����
+ </b> <span id=fps6>
+ <br>
+ </span>
+ </span></span> <span id=fps6> <br>
+ �������IJ�������ͼ��ʾ����ϵͳ����Ҫ���̣������û�˳�����ÿһ�����衣�û�ֻ�밴������ͼ��ͼ�񣬼�ϵͳ��ݷ�ʽ����ɽ����ض��Ĺ��ܻ��档</span></td>
+ <td height=129>
+
+
+ <p align=justify>
+
+
+ <em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><font size=4 face="Times New Roman">Highlights :</font><span id=fps6><br>
+ </span>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Easy Access
+ </span> <span id=fps6>
+ <br>
+ </span>
+ </span></font> <font size=2> <br>
+ <span id=fps9>A Road Map showing the user-friendly system
+ flow guides users throughout all steps. User can click on the menu icons,
+ which act as shortcuts, and enter into the desired function.</span></font></p>
+ </td>
+ </tr>
+ <tr valign=top>
+ <td height=135>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;���ƵIJ�ѯ��Ѱ��
+ </b> <span id=fps6>
+ <br>
+ </span>
+ </span></span> <span id=fps6>
+ <br>
+ ��Ա���ش�ͻ���ѯ�򷢳�������������ʱ�����������׼�¼��������̲����˷�ʱ�䣬��һ�ش�׼ȷ�������������Ӵ�ʧȥ�ⱦ��Ŀͻ�����ѯ��Ѱ�����ֲ�ͬ��ʵʱ��ѯ���ܣ��ܿ�����Ѱ��������ݼ�¼��ֻҪ�û�����ͻ���š���Ʒ��š���Ʊ���ڵ�����һ����Ѱ��������Ѱ����漴��ʾ�� </span>
+ </td>
+ <td height=135>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Perfect On-line Enquiry
+ </span> <span id=fps6>
+ <br>
+ </span>
+ </span></font> <font size=2>
+ <br>
+ <span id=fps9>Under many circumstances, staff also need to
+ retrieve past transaction history for handing customer enquiry or placing
+ an order, however they cannot get the required information immediately and
+ this may drive away the customers. On-line Enquiry engine enables staff to
+ check past transaction with searching parameters such as key words, client
+ code, item code, invoice date. </span>
+ </font></td>
+ </tr>
+ <tr valign=top>
+ <td height=83>
+ <span style="background-color: #339933; font-weight:700" id="fps7">&nbsp;�ļ����� </span><span id=fps6>
+ <br>
+ <br>
+ ϵͳ�����ʽӿ�����Գ��õĴ�ƱΪ�������û������ʱ������Ӧ��ͬ�ռ��ʸ�ʽ�������ܸ���Ч�ʵش����ճ�������������������</span></td>
+ <td height=83>
+ <font color=#FFFFFF face="Times New Roman">
+ <span style="background-color: #339933; font-weight:700">&nbsp;Input
+ Template </span></font><font size=2>
+ <br>
+ <br>
+ <span id=fps9>The data entry journal interface is similar
+ to paper voucher, so that users can handle their daily accounting
+ transaction as they used to, yet more efficient.</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=76>
+ <b>
+ <font color=#FFFFFF><span id=fps1>&nbsp;���޼�¼���� </span></font>&nbsp;</b><font size=2><br>
+ <br>
+ ϵͳ����ǿ�󣬲����¼�����������ޣ�����û�������ʱ�����κ�ʱ�ڵĽ��׼�¼��
+ </font>
+ </td>
+ <td height=76>
+ <font face="Times New Roman">
+ <b>
+ <font color=#FFFFFF><span id=fps1>&nbsp;Unlimited
+ Data Record </span></font>&nbsp;</b></font><font size=2><br>
+ <br>
+ <font face="Times New Roman">The system can store unlimited number of
+ records, so that users can retrieve data of any time whenever they need
+ it.</font></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=105>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;ϵͳ������
+ </b> <br>
+ </span></span> <span id=fps6>
+ <br>
+ �Ƚ��ĵ�����ϵͳ����(����)����ֻ����Ȩ�û����ģ�ϵͳ����Ա�������Ӧ�û���ְ�����趨�����û�������Ȩ�ޡ� </span></td>
+ <td height=105>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Login Control
+ </span> <br>
+ </span></font> <font size=2>
+ <br>
+ <span id=fps9>Advanced access control ensures access right
+ is only granted to authorized users. System administrator can also define
+ access level of each user according to their capacity, so that confidential
+ information can only be retrieved and viewed by senior management.</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=87>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;��ѡ������ʽ
+ </b> <br>
+ </span></span> <span id=fps6>
+ <br>
+ ϵͳ�����Կ���ʽ��ƣ�ֻ��Ҫ���Seagate Crystal Report (����)������������Ʊ�����ʽ�����ӱ�����</span></td>
+ <td height=87>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Customize Report
+ </span> <br>
+ </span></font> <font size=2>
+ <br>
+ <span id=fps9>The system is designed with an open architecture
+ format. When the system is used with&nbsp; Seagate Crystal Report Software, Users can
+ customize report content and format of the system.</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=100>
+ <font color=#FFFFFF><span id=fps1>
+ <b>&nbsp;�����Ѕn�������� <br>
+ </b>
+ </span></font> <span id=fps6>
+ <br>
+ ����80%�ı�������MS Excel/Word��ʽ���������Ҫ������ͼ�������ݷ���֮�á� <br>
+ ��������MS Excel/Word�ȸ�ʽ����������Ե��ʸ������͸��й���Ա�� </span></td>
+ <td height=100>
+ <font color=#FFFFFF><span id=fps1>
+ <b><font face="Times New Roman">&nbsp;Multi-Report Export Tools </font> <br>
+ </b>
+ </span></font> <font size=2>
+ <br>
+ <font face="Times New Roman">Over 80% of reports can be exported to MS
+ Excel /&nbsp; Word and data can be translated into graphs and tables for
+ further analysis.<br>
+ Reports can also be export to MS Excel / Word format independently or send
+ to email client with attachment directly.</font></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=118>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;���ʻ���֧��
+ </b> <br>
+ </span>
+ </span> <span id=fps6>
+ <br>
+ Ϊ����ϲ���ó�׹�˾�ڹ��ڻ������賧��ֹ�˾����Ҫ�������ݻ�ͨ��</span><strong><font size=2><span id=fps10>TRADEdotNET</span><font color=#FF0000> </font>
+ </font></strong>
+ <span id=fps6>�ṩȫ�氲ȫ������ƽ̨����װ</span><font color=#0066FF><strong><span id=fps10> TRADEdotNET </span></strong></font><span id=fps6>������֧�ָ�����͸�����������û�������ʱ����԰�װ�� </span><strong><font size=2>
+ <span id=fps10>TRADEdotNET</span><font color=#FF0000> </font>
+ </font></strong>
+ <span id=fps6>�ı�׼ MS ����ϵͳ����ʹ�á�</span></td>
+ <td height=118>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Internet Ready
+ </span> <br>
+ </span>
+ </font> <font size=2>
+ <br>
+ <span id=fps9>To facilitate data exchange between trading companies and their offices in
+ the Mainland China or Southeast Asia Country, </span> </font>
+ <font face="Times New Roman"> <span id=fps9>
+ Install and makes use of<strong><font color=#0066FF> TRADEdotNET</font>
+ Internet Kit </strong>&nbsp;to provide a secured platform enabling user
+ to access the data from different locations anytime through the internet
+ with </span><font color=#0066FF><strong><span id=fps10> TRADEdotNET </span></strong></font>
+ </font>
+ <span id=fps9>system. </span></td>
+ </tr>
+ <tr valign=top>
+ <td height=90>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;�������ݿ�֧��
+ </b> <br>
+ </span>
+ </span> <span id=fps6>
+ <br>
+ Ϊ����ϲ�ͬ��С��˾�ı�����Ҫ��</span><strong><span id=fps10>TRADEdotNET</span></strong><span id=fps6> �ṩ��ͬ���ݿ�汾�Թ�ѡ�����Ƴ��� MS Access��MS SQL�������Ƴ��� Oracle ���������ݿ⡣<br>
+ ��</span></td>
+ <td height=90>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Multi-Database Format
+ </span> <br>
+ </span>
+ </font> <span id=fps6>
+ <br>
+ </span><font face="Times New Roman"><strong><font size=2><!----><font color=#0066FF>TRADEdotNET</font><font color=#FF0000> </font>
+ </font></strong>
+ </font><span id=fps9>enables user to select
+ different database format versions to fit their company requirements. Now
+ users can choose from MS
+ Access and MS SQL version.&nbsp; Oracle and other database formats are coming soon.</span></td>
+ </tr>
+ <tr valign=top>
+ <td height=70>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;����֧�ֹ���
+ </b> <br>
+ </span></span>
+ <span id=fps6> <br>
+ ֧�ֶ��û���֧�ֶ๫˾��֧�ֶ���ң�֧�ֶ��棬֧�ֶ�����(����/Ӣ��)
+ </span></td>
+ <td height=70>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Multiple Functionality
+ </span> <br>
+ </span></font>
+ <font size=2> <br>
+ <span id=fps9>Support multi-users, multi-companies,
+ multi-currencies, multi-inventory, multi-languages (Chinese / English).</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=142>
+ <span id=fps7>
+ <span id=fps1>
+ <b>&nbsp;ϵͳҪ��
+ </b>
+ <br>
+ </span></span><span id=fps6><br>
+ ����̨<br>
+ Intel Pentium II (������) Processor PC<br>
+ Windows 98, ME, 2000 �� Windows NT 4.0<br>
+ ������ 64 MB RAM���Ƽ���128MB<br>
+ 256ɫ������֮SVGA��ʾ��<br>
+ 50MBӲ�̿ռ�<br>
+ Windows 98, ME, 2000 �� Windows NT 4.0 ֧��֮��ӡ��</span></td>
+ <td height=142>
+ <font color=#FFFFFF>
+ <span id=fps1>
+ <span id=fps8>
+ &nbsp;System
+ Requirements
+
+ </span>
+ <br>
+ </span></font><font size=2><br>
+ <span id=fps9>
+ Workstation<br>
+ Intel Pentium II (or above) Processor PC<br>
+ Windows 98, ME, 2000 or Windows NT 4.0<br>
+ 64MB RAM
+ minimum�� 128MB
+ recommended<br>
+ 256 color SVGA display or higher<br>
+ 50MB free Hard Disk<br>
+ Printers
+ supported by
+ Windows 98, ME, 2000 �� Windows NT 4.0<br>
+ ��</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=436>
+ <span id=fps7>
+ <span id=fps1>&nbsp;����Χ
+ </span></span><span id=fps6>
+ <br>
+ <br>
+ ϵͳʾ��<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; ���������ϵͳʾ��
+ ��<br>
+ <br>
+ ϵͳ��װ<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; ϵͳ��װ���ɱ���˾רҵ����ʦ����
+ ��<br>
+ <br>
+ ���ݱ��ݼ���ԭ<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; ���Ϊ�ͻ��趨���ݱ��ݼ���ԭ��ť������Ͽͻ�֮�������豸����<br>
+ <br>
+ ���������ļ�ʽ��<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Ϊ�ͻ����������ļ�ʽ������߹�˾����(����)��<br>
+ <br>
+ ϵͳִ��<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Ϊ�������趨ϵͳ���̱����������ŵ�ִ�����
+ ��<br>
+ <br>
+ �û���ѵ<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; �û���ѵ�����ڿͻ��칫�ң����Ҳ��޴���
+ ��<br>
+ <br>
+ ϵͳ��ѯ����<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; �ṩ��Чֱ�ӵ�������ѯ���񣬴���ϵͳ����
+ ��<br>
+ <br>
+ ϵͳ����<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; ������ѱ���
+ �� <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; �ڱ����������Ϊ�ͻ���ϵͳ����
+ ��</span></td>
+ <td height=436>
+ <font color=#FFFFFF face="Times New Roman">
+ <span id=fps1>&nbsp;Services
+ Provided
+ </span></font><font size=2>
+ <br>
+ <br>
+ <span id=fps9>System Demonstration<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Free-of-charge system demonstration in client's office<br>
+ <br>
+ System Installation<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;
+ On-site
+ installation
+ by our
+ professional
+ engineers <br>
+ <br>
+ Backup/Restore<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Setups of backup and restore icons associated with client's backup device (e.g. Zip Drive, MO)<br>
+ <br>
+ Tailored Format<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Tailored designs on document formats to highlight and promote company image<br>
+ <br>
+ System Implementation<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;
+ Implementation
+ procedures
+ customized for
+ each
+ organization <br>
+ <br>
+ User Training<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Unlimited training is provided in the client's office
+ <br>
+ <br>
+ Hot-line Enquiry<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Efficient hot-line support for all system enquiries<br>
+ <br>
+ System Maintenance<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Half-a-year free maintenance <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free
+ upgrade
+ services
+ throughout
+ warranty
+ periods </span>
+ </font>
+ </td>
+ </tr>
+ </table>
+ <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 width=100% id=AutoNumber3>
+ <tr>
+ <td width=100%><b><font size=6 color=#FFFFFF>
+ <span style="background-color: #0000FF"><br>
+ �� ӭ Ԥ Լ ʾ ��&nbsp;��� : (852) 2591 9377</span></font></b><p>�� Ѷ �� �� ��
+ �� �� ˾&nbsp; Superdata International Ltd.<br>
+ Tel: (852) 2591 9377 </td>
+ </tr>
+ </table>
+ <p>
+ <font size=1>
+ <font face="Times New Roman">
+ *All prices,
+ conditions and
+ system
+ specifications
+ are subject to
+ change without
+ prior notice.
+ </font>���м۸����漰ϵͳ���֮�޸ģ���������֪ͨ��</font><span id=fps6>
+
+��</span> </p>
+
+ </body></html>
diff --git a/camel/tests/mime-filter/charset-gb2312.0.out b/camel/tests/mime-filter/charset-gb2312.0.out
new file mode 100644
index 0000000000..8dcae6bdfc
--- /dev/null
+++ b/camel/tests/mime-filter/charset-gb2312.0.out
@@ -0,0 +1,448 @@
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
+<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<title>一站式的贸易、库存及会计管理系统 An all-in-one solution for trading, inventory, accounting management</title>
+
+
+<style>
+<!--
+#fps0 {font-style: normal}
+#fps1 {background-color: #339933}
+#fps2 {font-family:times new roman;font-size:24pt;color:#0066ff;}
+#fps3 {font-family:times new roman;font-size:18pt;color:#0066ff;}
+#fps4 {font-family:SimSun;font-size:14pt}
+#fps5 {color:#0066ff;font-weight:bold;}
+#fps6 {font-size:10pt;}
+#fps7 {color:#ffffff;}
+#fps8 {font-family:times new roman;color:#ffffff;font-weight:bold;}
+#fps9 {font-family:times new roman;font-size:10pt;}
+#fps10 {font-size:10pt;color:#0066ff;}
+-->
+</style>
+
+</head>
+
+<body topmargin="0" leftmargin="10" bgcolor="#FFFFFF" >
+ <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 id=AutoNumber1 height=233>
+ <tr valign=top>
+ <td height=165>
+ <p align=justify>
+
+
+ <em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><font color=#FF0000>
+ <strong><font size=2>&nbsp;<br>
+ </font></strong></font><font face=SimSun size=2>是一站式的贸易、库存及会计管理系统,助您精简周而复始的资料输入、数据处理及各类报价、发票、存仓、日记帐、传票、报表等所需的文件行政工作,让您更有效地管理贸易、库存及会计事务。</font></td>
+ <td height=165>
+ <p align=justify>
+
+
+ <em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><font size=2><!----><font color=#FF0000>
+ <strong>&nbsp;<br>
+ <font face="Times New Roman">What's the most annoying part during your
+ work? </font>
+ </strong></font><font face="Times New Roman">Endless repetitive data
+ entry, calculation and paper work on quotation, invoice, inventory
+ management, daily voucher, journal and reporting? Once you have installed<span id=fps5>
+ TRADEdotNET</span>,<span id=fps5> </span>all of these
+ annoying work will never appear in your office again!<span id=fps5><br>
+ TRADEdotNET</span> is an all-in-one solution for trading, inventory,
+ accounting management. In the <span id=fps5>TRADEdotNET</span>&nbsp;
+ environment, all data can be continuously retrieved and reused. This will
+ help you for minimizing time consumed on data entry and enhancing
+ efficiency.</font></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=68><em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span>分别由<span lang=zh-tw>三</span>组系统组成:贸易订单管理<font face=SimSun>、库存</font>管理及会计系统</td>
+ <td height=68><em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><font face="Times New Roman">Containing Trading Management
+ Module, Inventory Management Module and Accounting Management Module.</font></td>
+ </tr>
+ </table>
+ <p align=center><span id=fps6>
+ <img border=0 src=Flow2.gif width=600 height=420></span></p>
+ <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 id=AutoNumber2 height=15>
+ <tr valign=top>
+ <td height=129>
+ <em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><span id=fps6>的优点</span><span lang=zh-tw><!----><span id=fps6>:</span></span><span id=fps6><br>
+ </span>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;简易系统登入
+ </b> <span id=fps6>
+ <br>
+ </span>
+ </span></span> <span id=fps6> <br>
+ 简单易明的操作流程图显示整个系统的主要流程,引导用户顺利完成每一个步骤。用户只须按下流程图的图像,即系统快捷方式,便可进入特定的功能画面。</span></td>
+ <td height=129>
+
+
+ <p align=justify>
+
+
+ <em id=fps0>
+ <strong>
+ <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
+ </span><font size=4 face="Times New Roman">Highlights :</font><span id=fps6><br>
+ </span>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Easy Access
+ </span> <span id=fps6>
+ <br>
+ </span>
+ </span></font> <font size=2> <br>
+ <span id=fps9>A Road Map showing the user-friendly system
+ flow guides users throughout all steps. User can click on the menu icons,
+ which act as shortcuts, and enter into the desired function.</span></font></p>
+ </td>
+ </tr>
+ <tr valign=top>
+ <td height=135>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;完善的查询搜寻器
+ </b> <span id=fps6>
+ <br>
+ </span>
+ </span></span> <span id=fps6>
+ <br>
+ 当员工回答客户查询或发出订单,经常需时翻查以往交易纪录,这个过程不仅浪费时间,万一回答不准确,更可能令您从此失去这宝贵的客户。查询搜寻器多种不同的实时查询功能,能快速搜寻所需的数据纪录,只要用户输入客户编号、货品编号、发票日期等其中一项搜寻参数,搜寻结果随即显示。 </span>
+ </td>
+ <td height=135>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Perfect On-line Enquiry
+ </span> <span id=fps6>
+ <br>
+ </span>
+ </span></font> <font size=2>
+ <br>
+ <span id=fps9>Under many circumstances, staff also need to
+ retrieve past transaction history for handing customer enquiry or placing
+ an order, however they cannot get the required information immediately and
+ this may drive away the customers. On-line Enquiry engine enables staff to
+ check past transaction with searching parameters such as key words, client
+ code, item code, invoice date. </span>
+ </font></td>
+ </tr>
+ <tr valign=top>
+ <td height=83>
+ <span style="background-color: #339933; font-weight:700" id="fps7">&nbsp;文件输入 </span><span id=fps6>
+ <br>
+ <br>
+ 系统的总帐接口设计以常用的传票为蓝本,用户无需费时重新适应不同日记帐格式,而且能更有效率地处理日常会计帐项数据输入程序。</span></td>
+ <td height=83>
+ <font color=#FFFFFF face="Times New Roman">
+ <span style="background-color: #339933; font-weight:700">&nbsp;Input
+ Template </span></font><font size=2>
+ <br>
+ <br>
+ <span id=fps9>The data entry journal interface is similar
+ to paper voucher, so that users can handle their daily accounting
+ transaction as they used to, yet more efficient.</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=76>
+ <b>
+ <font color=#FFFFFF><span id=fps1>&nbsp;无限纪录储存 </span></font>&nbsp;</b><font size=2><br>
+ <br>
+ 系统容量强大,不设纪录储存年期上限,因此用户可以随时查阅任何时期的交易纪录。
+ </font>
+ </td>
+ <td height=76>
+ <font face="Times New Roman">
+ <b>
+ <font color=#FFFFFF><span id=fps1>&nbsp;Unlimited
+ Data Record </span></font>&nbsp;</b></font><font size=2><br>
+ <br>
+ <font face="Times New Roman">The system can store unlimited number of
+ records, so that users can retrieve data of any time whenever they need
+ it.</font></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=105>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;系统登入监控
+ </b> <br>
+ </span></span> <span id=fps6>
+ <br>
+ 先进的登入监控系统保障(机密)数据只供授权用户查阅,系统管理员亦可以因应用户的职级而设定个别用户的阅览权限。 </span></td>
+ <td height=105>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Login Control
+ </span> <br>
+ </span></font> <font size=2>
+ <br>
+ <span id=fps9>Advanced access control ensures access right
+ is only granted to authorized users. System administrator can also define
+ access level of each user according to their capacity, so that confidential
+ information can only be retrieved and viewed by senior management.</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=87>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;自选报表格式
+ </b> <br>
+ </span></span> <span id=fps6>
+ <br>
+ 系统报表以开放式设计,只需要配合Seagate Crystal Report (另购),即可自行设计报表格式或增加报表。</span></td>
+ <td height=87>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Customize Report
+ </span> <br>
+ </span></font> <font size=2>
+ <br>
+ <span id=fps9>The system is designed with an open architecture
+ format. When the system is used with&nbsp; Seagate Crystal Report Software, Users can
+ customize report content and format of the system.</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=100>
+ <font color=#FFFFFF><span id=fps1>
+ <b>&nbsp;多向列n报表工具 <br>
+ </b>
+ </span></font> <span id=fps6>
+ <br>
+ 超过80%的报表可以MS Excel/Word格式输出,按需要而制作图表供数据分析之用。 <br>
+ 报表可以MS Excel/Word等格式独立输出或以电邮附带传送给有关人员。 </span></td>
+ <td height=100>
+ <font color=#FFFFFF><span id=fps1>
+ <b><font face="Times New Roman">&nbsp;Multi-Report Export Tools </font> <br>
+ </b>
+ </span></font> <font size=2>
+ <br>
+ <font face="Times New Roman">Over 80% of reports can be exported to MS
+ Excel /&nbsp; Word and data can be translated into graphs and tables for
+ further analysis.<br>
+ Reports can also be export to MS Excel / Word format independently or send
+ to email client with attachment directly.</font></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=118>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;国际互联支持
+ </b> <br>
+ </span>
+ </span> <span id=fps6>
+ <br>
+ 为了配合不少贸易公司于国内或东南亚设厂或分公司而需要数据数据互通,</span><strong><font size=2><span id=fps10>TRADEdotNET</span><font color=#FF0000> </font>
+ </font></strong>
+ <span id=fps6>提供全面安全的整合平台,安装</span><font color=#0066FF><strong><span id=fps10> TRADEdotNET </span></strong></font><span id=fps6>互联网支持附件,透过互联网,用户即可随时随地以安装了 </span><strong><font size=2>
+ <span id=fps10>TRADEdotNET</span><font color=#FF0000> </font>
+ </font></strong>
+ <span id=fps6>的标准 MS 操作系统登入使用。</span></td>
+ <td height=118>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Internet Ready
+ </span> <br>
+ </span>
+ </font> <font size=2>
+ <br>
+ <span id=fps9>To facilitate data exchange between trading companies and their offices in
+ the Mainland China or Southeast Asia Country, </span> </font>
+ <font face="Times New Roman"> <span id=fps9>
+ Install and makes use of<strong><font color=#0066FF> TRADEdotNET</font>
+ Internet Kit </strong>&nbsp;to provide a secured platform enabling user
+ to access the data from different locations anytime through the internet
+ with </span><font color=#0066FF><strong><span id=fps10> TRADEdotNET </span></strong></font>
+ </font>
+ <span id=fps9>system. </span></td>
+ </tr>
+ <tr valign=top>
+ <td height=90>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;多种数据库支持
+ </b> <br>
+ </span>
+ </span> <span id=fps6>
+ <br>
+ 为了配合不同大小公司的本身需要,</span><strong><span id=fps10>TRADEdotNET</span></strong><span id=fps6> 提供不同数据库版本以供选择。已推出有 MS Access、MS SQL,即将推出有 Oracle 及其它数据库。<br>
+  </span></td>
+ <td height=90>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Multi-Database Format
+ </span> <br>
+ </span>
+ </font> <span id=fps6>
+ <br>
+ </span><font face="Times New Roman"><strong><font size=2><!----><font color=#0066FF>TRADEdotNET</font><font color=#FF0000> </font>
+ </font></strong>
+ </font><span id=fps9>enables user to select
+ different database format versions to fit their company requirements. Now
+ users can choose from MS
+ Access and MS SQL version.&nbsp; Oracle and other database formats are coming soon.</span></td>
+ </tr>
+ <tr valign=top>
+ <td height=70>
+ <span id=fps7><!----><span id=fps1><b>&nbsp;其它支持功能
+ </b> <br>
+ </span></span>
+ <span id=fps6> <br>
+ 支持多用户,支持多公司,支持多货币,支持多库存,支持多语言(中文/英文)
+ </span></td>
+ <td height=70>
+ <font color=#FFFFFF><span id=fps1>
+ <span id=fps8>&nbsp;Multiple Functionality
+ </span> <br>
+ </span></font>
+ <font size=2> <br>
+ <span id=fps9>Support multi-users, multi-companies,
+ multi-currencies, multi-inventory, multi-languages (Chinese / English).</span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=142>
+ <span id=fps7>
+ <span id=fps1>
+ <b>&nbsp;系统要求
+ </b>
+ <br>
+ </span></span><span id=fps6><br>
+ 工作台<br>
+ Intel Pentium II (或以上) Processor PC<br>
+ Windows 98, ME, 2000 或 Windows NT 4.0<br>
+ 最少用 64 MB RAM,推荐用128MB<br>
+ 256色或以上之SVGA显示器<br>
+ 50MB硬盘空间<br>
+ Windows 98, ME, 2000 或 Windows NT 4.0 支持之打印机</span></td>
+ <td height=142>
+ <font color=#FFFFFF>
+ <span id=fps1>
+ <span id=fps8>
+ &nbsp;System
+ Requirements
+
+ </span>
+ <br>
+ </span></font><font size=2><br>
+ <span id=fps9>
+ Workstation<br>
+ Intel Pentium II (or above) Processor PC<br>
+ Windows 98, ME, 2000 or Windows NT 4.0<br>
+ 64MB RAM
+ minimum, 128MB
+ recommended<br>
+ 256 color SVGA display or higher<br>
+ 50MB free Hard Disk<br>
+ Printers
+ supported by
+ Windows 98, ME, 2000 或 Windows NT 4.0<br>
+  </span></font></td>
+ </tr>
+ <tr valign=top>
+ <td height=436>
+ <span id=fps7>
+ <span id=fps1>&nbsp;服务范围
+ </span></span><span id=fps6>
+ <br>
+ <br>
+ 系统示范<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 免费上门作系统示范
+ 。<br>
+ <br>
+ 系统安装<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 系统安装会由本公司专业工程师负责
+ 。<br>
+ <br>
+ 数据备份及还原<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 免费为客户设定数据备份及还原按钮,以配合客户之‘备份设备’。<br>
+ <br>
+ 度身订做文件式样<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 为客户度身订做文件式样,提高公司形象(另费)。<br>
+ <br>
+ 系统执行<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 为各机构设定系统流程表及监察各部门的执行情况
+ 。<br>
+ <br>
+ 用户培训<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 用户培训可设在客户办公室,而且不限次数
+ 。<br>
+ <br>
+ 系统咨询热线<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 提供有效直接的热线咨询服务,处理系统疑难
+ 。<br>
+ <br>
+ 系统保养<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 半年免费保养
+ ; <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; 于保养期内免费为客户作系统提升
+ 。</span></td>
+ <td height=436>
+ <font color=#FFFFFF face="Times New Roman">
+ <span id=fps1>&nbsp;Services
+ Provided
+ </span></font><font size=2>
+ <br>
+ <br>
+ <span id=fps9>System Demonstration<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Free-of-charge system demonstration in client's office<br>
+ <br>
+ System Installation<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;
+ On-site
+ installation
+ by our
+ professional
+ engineers <br>
+ <br>
+ Backup/Restore<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Setups of backup and restore icons associated with client's backup device (e.g. Zip Drive, MO)<br>
+ <br>
+ Tailored Format<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Tailored designs on document formats to highlight and promote company image<br>
+ <br>
+ System Implementation<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;
+ Implementation
+ procedures
+ customized for
+ each
+ organization <br>
+ <br>
+ User Training<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Unlimited training is provided in the client's office
+ <br>
+ <br>
+ Hot-line Enquiry<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Efficient hot-line support for all system enquiries<br>
+ <br>
+ System Maintenance<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; Half-a-year free maintenance <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free
+ upgrade
+ services
+ throughout
+ warranty
+ periods </span>
+ </font>
+ </td>
+ </tr>
+ </table>
+ <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 width=100% id=AutoNumber3>
+ <tr>
+ <td width=100%><b><font size=6 color=#FFFFFF>
+ <span style="background-color: #0000FF"><br>
+ 欢 迎 预 约 示 范&nbsp;请电 : (852) 2591 9377</span></font></b><p>精 讯 国 际 有
+ 限 公 司&nbsp; Superdata International Ltd.<br>
+ Tel: (852) 2591 9377 </td>
+ </tr>
+ </table>
+ <p>
+ <font size=1>
+ <font face="Times New Roman">
+ *All prices,
+ conditions and
+ system
+ specifications
+ are subject to
+ change without
+ prior notice.
+ </font>所有价格,条规及系统规格之修改,将不另行通知。</font><span id=fps6>
+
+ </span> </p>
+
+ </body></html>
diff --git a/camel/tests/mime-filter/charset-iso-2022-jp.0.in b/camel/tests/mime-filter/charset-iso-2022-jp.0.in
new file mode 100644
index 0000000000..8c23b208ce
--- /dev/null
+++ b/camel/tests/mime-filter/charset-iso-2022-jp.0.in
@@ -0,0 +1,5 @@
+$B$($m$$#t#y$&$H$&$#$&$$$(#y$F#r$A$&$(#r#y$H#y#r$H$($D$*#3#9#4#5#0#9#8#0#9#4$($$#r(B
+$B$H$($D$*$($&$H$($k$H$&#t(B
+
+Thanks & Regards,
+Sures
diff --git a/camel/tests/mime-filter/charset-iso-2022-jp.0.out b/camel/tests/mime-filter/charset-iso-2022-jp.0.out
new file mode 100644
index 0000000000..c66c5f79ce
--- /dev/null
+++ b/camel/tests/mime-filter/charset-iso-2022-jp.0.out
@@ -0,0 +1,5 @@
+えろいtyうとうぃういえyてrちうえryとyrとえつお3945098094えいr
+とえつおえうとえるとうt
+
+Thanks & Regards,
+Sures
diff --git a/camel/tests/mime-filter/test-charset.c b/camel/tests/mime-filter/test-charset.c
new file mode 100644
index 0000000000..301cf3b2b7
--- /dev/null
+++ b/camel/tests/mime-filter/test-charset.c
@@ -0,0 +1,140 @@
+/*
+ test-crlf.c
+
+ Test the CamelMimeFilterCharset class
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <dirent.h>
+
+#include "camel-test.h"
+
+#include <camel/camel-stream-fs.h>
+#include <camel/camel-stream-mem.h>
+#include <camel/camel-stream-filter.h>
+#include <camel/camel-mime-filter-charset.h>
+
+#define d(x) x
+
+#define CHUNK_SIZE 4096
+
+int
+main (int argc, char **argv)
+{
+ ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
+ char comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
+ CamelStream *source;
+ CamelStream *correct;
+ CamelStreamFilter *filter;
+ CamelMimeFilter *f;
+ struct dirent *dent;
+ int i, test = 0;
+ DIR *dir;
+
+ camel_test_init(argc, argv);
+
+ dir = opendir (SOURCEDIR);
+
+ while ((dent = readdir (dir))) {
+ char *outfile, *charset, *work;
+ const char *ext;
+
+ ext = strrchr (dent->d_name, '.');
+ if (!(!strncmp (dent->d_name, "charset-", 8) && ext && !strcmp (ext, ".in")))
+ continue;
+
+ work = g_strdup_printf ("Charset filter, test case %d (%s)", test++, dent->d_name);
+ camel_test_start (work);
+ g_free (work);
+
+ if (!(source = camel_stream_fs_new_with_name (dent->d_name, 0, O_RDONLY))) {
+ camel_test_fail ("Failed to open input case in \"%s\"", dent->d_name);
+ continue;
+ }
+
+ outfile = g_strdup_printf ("%.*s.out", ext - dent->d_name, dent->d_name);
+
+ if (!(correct = camel_stream_fs_new_with_name (outfile, 0, O_RDONLY))) {
+ camel_test_fail ("Failed to open correct output in \"%s\"", outfile);
+ g_free (outfile);
+ continue;
+ }
+ g_free (outfile);
+
+ if (!(filter = camel_stream_filter_new_with_stream (CAMEL_STREAM (source)))) {
+ camel_test_fail ("Couldn't create CamelStreamFilter??");
+ continue;
+ }
+
+ charset = g_strdup (dent->d_name + 8);
+ ext = strchr (charset, '.');
+ *((char *) ext) = '\0';
+
+ if (!(f = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "UTF-8"))) {
+ camel_test_fail ("Couldn't create CamelMimeFilterCharset??");
+ g_free (charset);
+ continue;
+ }
+ g_free (charset);
+
+ camel_stream_filter_add (filter, f);
+ camel_object_unref (f);
+
+ camel_test_push ("Running filter and comparing to correct result");
+
+ comp_progress = 0;
+
+ while (1) {
+ comp_correct_chunk = camel_stream_read (correct, comp_correct, CHUNK_SIZE);
+ comp_filter_chunk = 0;
+
+ if (comp_correct_chunk == 0)
+ break;
+
+ while (comp_filter_chunk < comp_correct_chunk) {
+ ssize_t delta;
+
+ delta = camel_stream_read (CAMEL_STREAM (filter),
+ comp_filter + comp_filter_chunk,
+ CHUNK_SIZE - comp_filter_chunk);
+
+ if (delta == 0) {
+ camel_test_fail ("Chunks are different sizes: correct is %d, "
+ "filter is %d, %d bytes into stream",
+ comp_correct_chunk, comp_filter_chunk, comp_progress);
+ }
+
+ comp_filter_chunk += delta;
+ }
+
+ for (i = 0; i < comp_filter_chunk; i++) {
+ if (comp_correct[i] != comp_filter[i]) {
+ camel_test_fail ("Difference: correct is %c, filter is %c, "
+ "%d bytes into stream",
+ comp_correct[i],
+ comp_filter[i],
+ comp_progress + i);
+ }
+ }
+
+ comp_progress += comp_filter_chunk;
+ }
+
+ camel_test_pull ();
+
+ /* inefficient */
+ camel_test_push ("Cleaning up");
+ camel_object_unref (CAMEL_OBJECT (filter));
+ camel_object_unref (CAMEL_OBJECT (correct));
+ camel_object_unref (CAMEL_OBJECT (source));
+ camel_test_pull ();
+
+ camel_test_end ();
+ }
+
+ closedir (dir);
+
+ return 0;
+}
diff --git a/camel/tests/mime-filter/test-crlf.c b/camel/tests/mime-filter/test-crlf.c
index 0ffa5b2b26..bbf443be09 100644
--- a/camel/tests/mime-filter/test-crlf.c
+++ b/camel/tests/mime-filter/test-crlf.c
@@ -17,7 +17,7 @@
#define d(x) x
#define NUM_CASES 1
-#define CHUNK_SIZE 32
+#define CHUNK_SIZE 4096
enum {
CRLF_ENCODE,
@@ -49,7 +49,7 @@ main (int argc, char **argv)
for (j = CRLF_ENCODE; j < CRLF_DONE; j++) {
CamelMimeFilterCRLFDirection direction;
- char *infile, *outfile;
+ char *infile = NULL, *outfile = NULL;
switch (j) {
case CRLF_ENCODE:
@@ -127,9 +127,6 @@ main (int argc, char **argv)
comp_filter_chunk += delta;
}
- d(printf ("\n\nCORRECT: >>%.*s<<", comp_correct_chunk, comp_correct));
- d(printf ("\nFILTER : >>%.*s<<\n", comp_filter_chunk, comp_filter));
-
for (comp_i = 0; comp_i < comp_filter_chunk; comp_i++) {
if (comp_correct[comp_i] != comp_filter[comp_i]) {
camel_test_fail ("Difference: correct is %c, filter is %c, "