test-copy.c revision cda134ab1eac84f874aacf8e885a07112a7fd5ce
/***
This file is part of systemd
Copyright 2014 Ronny Chevalier
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <unistd.h>
#include "copy.h"
#include "path-util.h"
#include "fileio.h"
#include "mkdir.h"
#include "strv.h"
#include "macro.h"
#include "util.h"
static void test_copy_file(void) {
char fn[] = "/tmp/test-copy_file.XXXXXX";
char fn_copy[] = "/tmp/test-copy_file.XXXXXX";
int fd;
}
static void test_copy_file_fd(void) {
char in_fn[] = "/tmp/test-copy-file-fd-XXXXXX";
char out_fn[] = "/tmp/test-copy-file-fd-XXXXXX";
char text[] = "boohoo\nfoo\n\tbar\n";
char buf[64] = {0};
}
static void test_copy_tree(void) {
char original_dir[] = "/tmp/test-copy_tree/";
char copy_dir[] = "/tmp/test-copy_tree-copy/";
char **p, **link;
rm_rf_dangerous(copy_dir, false, true, false);
rm_rf_dangerous(original_dir, false, true, false);
STRV_FOREACH(p, files) {
char *f = strappenda(original_dir, *p);
}
char *f = strappenda(original_dir, *p);
}
STRV_FOREACH(p, files) {
char *f = strappenda(copy_dir, *p);
}
char *f = strappenda(original_dir, *p);
}
rm_rf_dangerous(copy_dir, false, true, false);
rm_rf_dangerous(original_dir, false, true, false);
}
return 0;
}