bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy_file_preserving variant that doesn't exit on error?


From: Bruno Haible
Subject: Re: copy_file_preserving variant that doesn't exit on error?
Date: Thu, 12 Jan 2012 14:26:40 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

Hi Reuben,

Reuben Thomas wrote:
> I find no tests for specific return codes from qcopy_file_preserving (grep
> GL_COPY gives no hits in gnulib/tests/), and I can find no test
> involving /dev/null (all instances I can find are redirections, not
> parameters to a test).

Yes, I added a test for whether qcopy_file_preserving works on its own
(i.e. in a program that does not also call copy_file_preserving).

If you want to add tests for some of the specific return codes, please do
so, without changing the part that calls copy_file_preserving. Also please
don't write on file1. But you can construct different destination file names
based on file2.

Generally it's desirable to write tests in such a way that the different
parts of the tests operate on different destination files:
  - If the test fails, the state on disk contains more info about what
    failed.
  - When adding new code to the test, you don't need to consider the
    specific state of the destination file, reading through all the code
    before. Just add a new destination file.
Using the same source file (file1) throughout the entire test is OK, though,
because it doesn't change.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]