test-copy.c revision ad5ecc113821fbfa33f6fd43cdaee9c538cdff78
/***
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"
#include "rm-rf.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;
STRV_FOREACH(p, files) {
char *f = strjoina(original_dir, *p);
}
char *f = strjoina(original_dir, *p);
}
STRV_FOREACH(p, files) {
}
char *f = strjoina(original_dir, *p);
}
}
static void test_copy_bytes(void) {
int r, r2;
assert_se(r == 0);
assert_se(r >= 0);
/* test copy_bytes with invalid descriptors */
}
return 0;
}