Discussion:
[PATCH] Add tests for head, fix a small output bug
(too old to reply)
Tim Elliott
2012-02-10 07:29:24 UTC
Permalink
Add tests for head

This exposed one issue in head.c -- printf was not flushing and
file names could appear after file contents instead of before.

scripts/test/head.test | 17 +++++++++++++++++
toys/head.c | 1 +
2 files changed, 18 insertions(+), 0 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: head_tests.patch
Type: text/x-patch
Size: 1540 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120209/c924068b/attachment.bin>
Tim Elliott
2012-02-10 20:09:36 UTC
Permalink
Post by Tim Elliott
This exposed one issue in head.c -- printf was not flushing and
file names could appear after file contents instead of before.
I should have used xflush() from lib.c.

Will resend the patch tonight.

Cheers,
Tim
Tim Elliott
2012-02-11 06:02:16 UTC
Permalink
Post by Tim Elliott
I should have used xflush() from lib.c.
Updated patch attached.

Cheers,
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: head_tests_ii.patch
Type: text/x-patch
Size: 1596 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120210/b5901a43/attachment.bin>
Tim Elliott
2012-02-11 06:02:16 UTC
Permalink
Post by Tim Elliott
I should have used xflush() from lib.c.
Updated patch attached.

Cheers,
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: head_tests_ii.patch
Type: text/x-patch
Size: 1596 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120210/b5901a43/attachment-0002.bin>
Tim Elliott
2012-02-10 07:29:24 UTC
Permalink
Add tests for head

This exposed one issue in head.c -- printf was not flushing and
file names could appear after file contents instead of before.

scripts/test/head.test | 17 +++++++++++++++++
toys/head.c | 1 +
2 files changed, 18 insertions(+), 0 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: head_tests.patch
Type: text/x-patch
Size: 1540 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120209/c924068b/attachment-0002.bin>
Tim Elliott
2012-02-10 20:09:36 UTC
Permalink
Post by Tim Elliott
This exposed one issue in head.c -- printf was not flushing and
file names could appear after file contents instead of before.
I should have used xflush() from lib.c.

Will resend the patch tonight.

Cheers,
Tim
Continue reading on narkive:
Loading...