mh: further fixes in burst testsuite.
* mh/burst.c: Minor changes. * mh/tests/burst.at: Remove host-specific information.
Showing
2 changed files
with
12 additions
and
22 deletions
... | @@ -291,7 +291,7 @@ flush_stream (struct burst_stream *bs, char *buf, size_t size) | ... | @@ -291,7 +291,7 @@ flush_stream (struct burst_stream *bs, char *buf, size_t size) |
291 | 291 | ||
292 | /* Burst an RFC 934 digest. Return 0 if OK, 1 if the message is not | 292 | /* Burst an RFC 934 digest. Return 0 if OK, 1 if the message is not |
293 | a valid digest. | 293 | a valid digest. |
294 | FIXME: On errors, cleanup and return -1 | 294 | FIXME: On errors, cleanup and return -1. |
295 | */ | 295 | */ |
296 | int | 296 | int |
297 | burst_digest (mu_message_t msg) | 297 | burst_digest (mu_message_t msg) |
... | @@ -299,7 +299,6 @@ burst_digest (mu_message_t msg) | ... | @@ -299,7 +299,6 @@ burst_digest (mu_message_t msg) |
299 | mu_stream_t is; | 299 | mu_stream_t is; |
300 | char c; | 300 | char c; |
301 | size_t n; | 301 | size_t n; |
302 | size_t count; | ||
303 | int state = S1; | 302 | int state = S1; |
304 | int eb_length = 0; | 303 | int eb_length = 0; |
305 | struct burst_stream bs; | 304 | struct burst_stream bs; |
... | @@ -311,8 +310,7 @@ burst_digest (mu_message_t msg) | ... | @@ -311,8 +310,7 @@ burst_digest (mu_message_t msg) |
311 | mh_message_number (msg, &bs.msgno); | 310 | mh_message_number (msg, &bs.msgno); |
312 | 311 | ||
313 | mu_message_get_streamref (msg, &is); | 312 | mu_message_get_streamref (msg, &is); |
314 | while (mu_stream_read (is, &c, 1, &n) == 0 | 313 | while (mu_stream_read (is, &c, 1, &n) == 0 && n == 1) |
315 | && n == 1) | ||
316 | { | 314 | { |
317 | int newstate = transtab[state - 1][token_num (c)]; | 315 | int newstate = transtab[state - 1][token_num (c)]; |
318 | int silent = 0; | 316 | int silent = 0; |
... | @@ -340,7 +338,7 @@ burst_digest (mu_message_t msg) | ... | @@ -340,7 +338,7 @@ burst_digest (mu_message_t msg) |
340 | } | 338 | } |
341 | } | 339 | } |
342 | else | 340 | else |
343 | for (; eb_length; eb_length--, count++) | 341 | for (; eb_length; eb_length--) |
344 | flush_stream (&bs, "-", 1); | 342 | flush_stream (&bs, "-", 1); |
345 | eb_length = 0; | 343 | eb_length = 0; |
346 | } | 344 | } |
... | @@ -360,10 +358,7 @@ burst_digest (mu_message_t msg) | ... | @@ -360,10 +358,7 @@ burst_digest (mu_message_t msg) |
360 | } | 358 | } |
361 | state = newstate; | 359 | state = newstate; |
362 | if (!silent) | 360 | if (!silent) |
363 | { | 361 | flush_stream (&bs, &c, 1); |
364 | flush_stream (&bs, &c, 1); | ||
365 | count++; | ||
366 | } | ||
367 | } | 362 | } |
368 | mu_stream_destroy (&is); | 363 | mu_stream_destroy (&is); |
369 | 364 | ||
... | @@ -639,9 +634,9 @@ main (int argc, char **argv) | ... | @@ -639,9 +634,9 @@ main (int argc, char **argv) |
639 | mh_msgset_uids (mbox, &ms); | 634 | mh_msgset_uids (mbox, &ms); |
640 | 635 | ||
641 | mu_mailbox_get_url (mbox, &dst_url); | 636 | mu_mailbox_get_url (mbox, &dst_url); |
642 | dir = mu_url_to_string (dst_url); | 637 | mu_url_sget_path (dst_url, &dir); |
643 | VERBOSE ((_("changing to `%s'"), dir + 3)); | 638 | VERBOSE ((_("changing to `%s'"), dir)); |
644 | if (chdir (dir+3)) | 639 | if (chdir (dir)) |
645 | { | 640 | { |
646 | mu_error (_("cannot change to `%s': %s"), dir, mu_strerror (errno)); | 641 | mu_error (_("cannot change to `%s': %s"), dir, mu_strerror (errno)); |
647 | exit (1); | 642 | exit (1); | ... | ... |
... | @@ -125,13 +125,12 @@ Sergey | ... | @@ -125,13 +125,12 @@ Sergey |
125 | MH_CHECK([burst mime],[burst02 burst-mime],[ | 125 | MH_CHECK([burst mime],[burst02 burst-mime],[ |
126 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 126 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
127 | burst +inbox 3 || exit $? | 127 | burst +inbox 3 || exit $? |
128 | grep -v ^X-Envelope-Date: Mail/inbox/6 | 128 | grep -v ^X-Envelope- Mail/inbox/6 |
129 | ], | 129 | ], |
130 | [0], | 130 | [0], |
131 | [Content-Type: text/plain; name="msg.1"; charset="us-ascii" | 131 | [Content-Type: text/plain; name="msg.1"; charset="us-ascii" |
132 | Content-ID: <5082.1026510189.1@example.net> | 132 | Content-ID: <5082.1026510189.1@example.net> |
133 | Content-Description: How doth | 133 | Content-Description: How doth |
134 | X-Envelope-Sender: gray@Trurl.gnu.org.ua | ||
135 | 134 | ||
136 | How doth the little crocodile | 135 | How doth the little crocodile |
137 | Improve his shining tail, | 136 | Improve his shining tail, |
... | @@ -147,16 +146,15 @@ With gently smiling jaws! | ... | @@ -147,16 +146,15 @@ With gently smiling jaws! |
147 | MH_CHECK([burst mime recursive],[burst03 burst-mime-recursive],[ | 146 | MH_CHECK([burst mime recursive],[burst03 burst-mime-recursive],[ |
148 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 147 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
149 | burst +inbox --recursive 4 || exit $? | 148 | burst +inbox --recursive 4 || exit $? |
150 | grep -v ^X-Envelope-Date: Mail/inbox/6 | 149 | grep -v ^X-Envelope- Mail/inbox/6 |
151 | grep -v ^X-Envelope-Date: Mail/inbox/7 | 150 | grep -v ^X-Envelope- Mail/inbox/7 |
152 | grep -v ^X-Envelope-Date: Mail/inbox/8 | 151 | grep -v ^X-Envelope- Mail/inbox/8 |
153 | grep -v ^X-Envelope-Date: Mail/inbox/9 | 152 | grep -v ^X-Envelope- Mail/inbox/9 |
154 | ], | 153 | ], |
155 | [0], | 154 | [0], |
156 | [Content-Type: text/plain; name="msg.21"; charset="us-ascii" | 155 | [Content-Type: text/plain; name="msg.21"; charset="us-ascii" |
157 | Content-ID: <5122.1026510654.2@example.net> | 156 | Content-ID: <5122.1026510654.2@example.net> |
158 | Content-Description: Father William Part I | 157 | Content-Description: Father William Part I |
159 | X-Envelope-Sender: gray@Trurl.gnu.org.ua | ||
160 | 158 | ||
161 | `You are old, Father William,' the young man said, | 159 | `You are old, Father William,' the young man said, |
162 | `And your hair has become very white; | 160 | `And your hair has become very white; |
... | @@ -172,7 +170,6 @@ Content-Type: application/octet-stream; name="msg.22" | ... | @@ -172,7 +170,6 @@ Content-Type: application/octet-stream; name="msg.22" |
172 | Content-ID: <5122.1026510654.4@example.net> | 170 | Content-ID: <5122.1026510654.4@example.net> |
173 | Content-Description: Father William Part II | 171 | Content-Description: Father William Part II |
174 | Content-Transfer-Encoding: base64 | 172 | Content-Transfer-Encoding: base64 |
175 | X-Envelope-Sender: gray@Trurl.gnu.org.ua | ||
176 | 173 | ||
177 | YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBhcyBJIG1lbnRpb25lZCBiZWZvcmUsCkFu | 174 | YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBhcyBJIG1lbnRpb25lZCBiZWZvcmUsCkFu |
178 | ZCBoYXZlIGdyb3duIG1vc3QgdW5jb21tb25seSBmYXQ7CllldCB5b3UgdHVybmVkIGEgYmFjay1z | 175 | ZCBoYXZlIGdyb3duIG1vc3QgdW5jb21tb25seSBmYXQ7CllldCB5b3UgdHVybmVkIGEgYmFjay1z |
... | @@ -185,7 +182,6 @@ Content-Type: application/octet-stream; name="msg.23" | ... | @@ -185,7 +182,6 @@ Content-Type: application/octet-stream; name="msg.23" |
185 | Content-ID: <5122.1026510654.6@example.net> | 182 | Content-ID: <5122.1026510654.6@example.net> |
186 | Content-Description: Father William Part III | 183 | Content-Description: Father William Part III |
187 | Content-Transfer-Encoding: base64 | 184 | Content-Transfer-Encoding: base64 |
188 | X-Envelope-Sender: gray@Trurl.gnu.org.ua | ||
189 | 185 | ||
190 | YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBhbmQgeW91ciBqYXdzIGFyZSB0b28gd2Vh | 186 | YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBhbmQgeW91ciBqYXdzIGFyZSB0b28gd2Vh |
191 | awpGb3IgYW55dGhpbmcgdG91Z2hlciB0aGFuIHN1ZXQ7CllldCB5b3UgZmluaXNoZWQgdGhlIGdv | 187 | awpGb3IgYW55dGhpbmcgdG91Z2hlciB0aGFuIHN1ZXQ7CllldCB5b3UgZmluaXNoZWQgdGhlIGdv |
... | @@ -198,7 +194,6 @@ Content-Type: application/octet-stream; name="msg.24" | ... | @@ -198,7 +194,6 @@ Content-Type: application/octet-stream; name="msg.24" |
198 | Content-ID: <5122.1026510654.7@example.net> | 194 | Content-ID: <5122.1026510654.7@example.net> |
199 | Content-Description: Father William Part IV | 195 | Content-Description: Father William Part IV |
200 | Content-Transfer-Encoding: base64 | 196 | Content-Transfer-Encoding: base64 |
201 | X-Envelope-Sender: gray@Trurl.gnu.org.ua | ||
202 | 197 | ||
203 | YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBvbmUgd291bGQgaGFyZGx5IHN1cHBvc2UK | 198 | YFlvdSBhcmUgb2xkLCcgc2FpZCB0aGUgeW91dGgsIGBvbmUgd291bGQgaGFyZGx5IHN1cHBvc2UK |
204 | VGhhdCB5b3VyIGV5ZSB3YXMgYXMgc3RlYWR5IGFzIGV2ZXI7CllldCB5b3UgYmFsYW5jZWQgYW4g | 199 | VGhhdCB5b3VyIGV5ZSB3YXMgYXMgc3RlYWR5IGFzIGV2ZXI7CllldCB5b3UgYmFsYW5jZWQgYW4g | ... | ... |
-
Please register or sign in to post a comment