aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/test/test_open_fd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/test/test_open_fd.c')
-rw-r--r--libarchive/test/test_open_fd.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/libarchive/test/test_open_fd.c b/libarchive/test/test_open_fd.c
index ff5fab1ad45b..7da8b5ebcb56 100644
--- a/libarchive/test/test_open_fd.c
+++ b/libarchive/test/test_open_fd.c
@@ -42,6 +42,7 @@ DEFINE_TEST(test_open_fd)
struct archive_entry *ae;
struct archive *a;
int fd;
+ const char *skip_open_fd_err_test;
#if defined(__BORLANDC__)
fd = open("test.tar", O_RDWR | O_CREAT | O_BINARY);
@@ -116,16 +117,18 @@ DEFINE_TEST(test_open_fd)
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
close(fd);
-
- /*
- * Verify some of the error handling.
- */
- assert((a = archive_read_new()) != NULL);
- assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
- assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
- /* FD 100 shouldn't be open. */
- assertEqualIntA(a, ARCHIVE_FATAL,
- archive_read_open_fd(a, 100, 512));
- assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
- assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ skip_open_fd_err_test = getenv("SKIP_OPEN_FD_ERR_TEST");
+ if(skip_open_fd_err_test == NULL) {
+ /*
+ * Verify some of the error handling.
+ */
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ /* FD 100 shouldn't be open. */
+ assertEqualIntA(a, ARCHIVE_FATAL,
+ archive_read_open_fd(a, 100, 512));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ }
}