/* Test of copying of files.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "copy-file.h"
-#include <stdio.h>
#include <stdlib.h>
#include "progname.h"
-
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
- while (0)
+#include "macros.h"
int
main (int argc, char *argv[])
{
const char *file1;
const char *file2;
+ int null_stderr;
set_program_name (argv[0]);
file1 = argv[1];
file2 = argv[2];
+ null_stderr = (getenv ("NO_STDERR_OUTPUT") != NULL);
- copy_file_preserving (file1, file2);
+ if (null_stderr)
+ ASSERT (qcopy_file_preserving (file1, file2) == 0);
+ else
+ copy_file_preserving (file1, file2);
return 0;
}