diff options
author | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2011-12-31 16:37:38 -0500 |
---|---|---|
committer | Michihiro NAKAJIMA <ggcueroad@gmail.com> | 2011-12-31 16:37:38 -0500 |
commit | 7ed635f3ad7e8da4fc93b2c959661af1504e60e5 (patch) | |
tree | e3b1b0bbdf21df1d2c2a7c40a64ad9e2c7e2fc35 /libarchive/test/test_read_disk_directory_traversals.c | |
parent | 6e6673020211c99cd7095887e8ee00f59694ffb5 (diff) | |
download | libarchive-7ed635f3ad7e8da4fc93b2c959661af1504e60e5.tar.gz |
Enable canNodump and assertNodump on linux and move them into test/main.c
SVN-Revision: 4053
Diffstat (limited to 'libarchive/test/test_read_disk_directory_traversals.c')
-rw-r--r-- | libarchive/test/test_read_disk_directory_traversals.c | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/libarchive/test/test_read_disk_directory_traversals.c b/libarchive/test/test_read_disk_directory_traversals.c index 32fc2470..569d4745 100644 --- a/libarchive/test/test_read_disk_directory_traversals.c +++ b/libarchive/test/test_read_disk_directory_traversals.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2011 Michihiro NAKAJIMA + * Copyright (c) 2010-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,13 +25,7 @@ #include "test.h" __FBSDID("$FreeBSD$"); -#ifdef HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif #include <limits.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(__BORLANDC__) # define getcwd _getcwd @@ -1238,46 +1232,6 @@ test_callbacks(void) archive_entry_free(ae); } -#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP) -static int -canNodump() -{ - const char *path = "cannodumptest"; - struct stat sb; - - assertMakeFile(path, 0644, NULL); - if (chflags(path, UF_NODUMP) < 0) - return (0); - if (stat(path, &sb) < 0) - return (0); - if (sb.st_flags & UF_NODUMP) - return (1); - return (0); -} - -static int -assertNodump(const char *path) -{ - return (assertEqualInt(0, chflags(path, UF_NODUMP))); -} - -#else - -static int -canNodump() -{ - return (0); -} - -static int -assertNodump(const char *path) -{ - (void)path; /* UNUSED */ - return (0); -} - -#endif - static void test_nodump(void) { |