Commit 08562ac4 08562ac4ef9b4d07d6ac0ff56af04f83dc4a1075 by Sergey Poznyakoff

mh: further fixes in burst testsuite.

* mh/burst.c: Minor changes.
* mh/tests/burst.at: Remove host-specific information.
1 parent 3d266601
......@@ -291,7 +291,7 @@ flush_stream (struct burst_stream *bs, char *buf, size_t size)
/* Burst an RFC 934 digest. Return 0 if OK, 1 if the message is not
a valid digest.
FIXME: On errors, cleanup and return -1
FIXME: On errors, cleanup and return -1.
*/
int
burst_digest (mu_message_t msg)
......@@ -299,7 +299,6 @@ burst_digest (mu_message_t msg)
mu_stream_t is;
char c;
size_t n;
size_t count;
int state = S1;
int eb_length = 0;
struct burst_stream bs;
......@@ -311,8 +310,7 @@ burst_digest (mu_message_t msg)
mh_message_number (msg, &bs.msgno);
mu_message_get_streamref (msg, &is);
while (mu_stream_read (is, &c, 1, &n) == 0
&& n == 1)
while (mu_stream_read (is, &c, 1, &n) == 0 && n == 1)
{
int newstate = transtab[state - 1][token_num (c)];
int silent = 0;
......@@ -340,7 +338,7 @@ burst_digest (mu_message_t msg)
}
}
else
for (; eb_length; eb_length--, count++)
for (; eb_length; eb_length--)
flush_stream (&bs, "-", 1);
eb_length = 0;
}
......@@ -360,10 +358,7 @@ burst_digest (mu_message_t msg)
}
state = newstate;
if (!silent)
{
flush_stream (&bs, &c, 1);
count++;
}
flush_stream (&bs, &c, 1);
}
mu_stream_destroy (&is);
......@@ -639,9 +634,9 @@ main (int argc, char **argv)
mh_msgset_uids (mbox, &ms);
mu_mailbox_get_url (mbox, &dst_url);
dir = mu_url_to_string (dst_url);
VERBOSE ((_("changing to `%s'"), dir + 3));
if (chdir (dir+3))
mu_url_sget_path (dst_url, &dir);
VERBOSE ((_("changing to `%s'"), dir));
if (chdir (dir))
{
mu_error (_("cannot change to `%s': %s"), dir, mu_strerror (errno));
exit (1);
......
......@@ -125,13 +125,12 @@ Sergey
MH_CHECK([burst mime],[burst02 burst-mime],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
burst +inbox 3 || exit $?
grep -v ^X-Envelope-Date: Mail/inbox/6
grep -v ^X-Envelope- Mail/inbox/6
],
[0],
[Content-Type: text/plain; name="msg.1"; charset="us-ascii"
Content-ID: <5082.1026510189.1@example.net>
Content-Description: How doth
X-Envelope-Sender: gray@Trurl.gnu.org.ua
How doth the little crocodile
Improve his shining tail,
......@@ -147,16 +146,15 @@ With gently smiling jaws!
MH_CHECK([burst mime recursive],[burst03 burst-mime-recursive],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
burst +inbox --recursive 4 || exit $?
grep -v ^X-Envelope-Date: Mail/inbox/6
grep -v ^X-Envelope-Date: Mail/inbox/7
grep -v ^X-Envelope-Date: Mail/inbox/8
grep -v ^X-Envelope-Date: Mail/inbox/9
grep -v ^X-Envelope- Mail/inbox/6
grep -v ^X-Envelope- Mail/inbox/7
grep -v ^X-Envelope- Mail/inbox/8
grep -v ^X-Envelope- Mail/inbox/9
],
[0],
[Content-Type: text/plain; name="msg.21"; charset="us-ascii"
Content-ID: <5122.1026510654.2@example.net>
Content-Description: Father William Part I
X-Envelope-Sender: gray@Trurl.gnu.org.ua
`You are old, Father William,' the young man said,
`And your hair has become very white;
......@@ -172,7 +170,6 @@ Content-Type: application/octet-stream; name="msg.22"
Content-ID: <5122.1026510654.4@example.net>
Content-Description: Father William Part II
Content-Transfer-Encoding: base64
X-Envelope-Sender: gray@Trurl.gnu.org.ua
YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBhcyBJIG1lbnRpb25lZCBiZWZvcmUsCkFu
ZCBoYXZlIGdyb3duIG1vc3QgdW5jb21tb25seSBmYXQ7CllldCB5b3UgdHVybmVkIGEgYmFjay1z
......@@ -185,7 +182,6 @@ Content-Type: application/octet-stream; name="msg.23"
Content-ID: <5122.1026510654.6@example.net>
Content-Description: Father William Part III
Content-Transfer-Encoding: base64
X-Envelope-Sender: gray@Trurl.gnu.org.ua
YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBhbmQgeW91ciBqYXdzIGFyZSB0b28gd2Vh
awpGb3IgYW55dGhpbmcgdG91Z2hlciB0aGFuIHN1ZXQ7CllldCB5b3UgZmluaXNoZWQgdGhlIGdv
......@@ -198,7 +194,6 @@ Content-Type: application/octet-stream; name="msg.24"
Content-ID: <5122.1026510654.7@example.net>
Content-Description: Father William Part IV
Content-Transfer-Encoding: base64
X-Envelope-Sender: gray@Trurl.gnu.org.ua
YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBvbmUgd291bGQgaGFyZGx5IHN1cHBvc2UK
VGhhdCB5b3VyIGV5ZSB3YXMgYXMgc3RlYWR5IGFzIGV2ZXI7CllldCB5b3UgYmFsYW5jZWQgYW4g
......