On 02/13/2012 11:00 AM, Pádraig Brady wrote:
> On 02/13/2012 07:50 AM, Bernhard Voelker wrote:
>> On 02/10/2012 05:21 PM, Jérémy Compostella wrote:
>>
>> Sorry, this is a bit late, but I have 2 notes about the
>> new dd/bytes test:
>>
>>> diff --git a/tests/dd/bytes b/tests/dd/bytes
>>> new file mode 100755
>>> index 0000000..6038742
>>> --- /dev/null
>>> +++ b/tests/dd/bytes
>>> @@ -0,0 +1,57 @@
>>
>>> +# seek bytes
>>> +echo abcdefghijklm |
>>> + dd bs=5 seek=8 oflag=seek_bytes > out 2> /dev/null || fail=1
>>> +echo abcdefghijklm |
>>> + dd bs=4 seek=2 > expected 2> /dev/null || fail=1
>>> +compare expected out || fail=1
>>
>> I don't know why, but I somehow do not have a good feeling
>> about a test comparing the result of the program to be tested
>> with another run. If something cowardly fails, then this test
>> would succeed.
> 
> Fair point.

Thanks for the patch.

>>> +# seek bytes on empty file
>>> +echo abcdefghijklm |
>>> + dd bs=5 seek=8 oflag=seek_bytes > out2 2> /dev/null || fail=1
>>> +compare expected out2 || fail=1
>>
>> The comment is wrong here, isn't it?
> 
> Well out2 will be a new empty file.
> Though the case is no different to the previous
> (since conv=notrunc was not specified).
> So I'll just remove it.

Ah, I see. Thanks for the clarification.

BTW: shouldn't
   echo abcdefghijklm | src/dd bs=5 seek=8 oflag=seek_bytes
receive EPIPE? When run on a terminal, dd waits in read() forever.

Have a nice day,
Berny

Reply via email to