From 5395502c6a2e74727bb25e83384a5da0969b0f05 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Wed, 12 Mar 2014 08:50:51 +0100 Subject: fixes for test programs to be buildable by Open Watcom correct buffers to be realy local for each test as expected by logic --- libarchive/test/main.c | 5 ++++- libarchive/test/test.h | 2 +- libarchive/test/test_read_data_large.c | 6 +++--- libarchive/test/test_read_truncated.c | 4 ++-- libarchive/test/test_write_filter_program.c | 4 ++-- libarchive/test/test_write_format_ar.c | 4 ++-- libarchive/test/test_write_format_gnutar.c | 2 +- libarchive/test/test_write_format_iso9660.c | 2 +- libarchive/test/test_write_format_iso9660_boot.c | 2 +- libarchive/test/test_write_format_pax.c | 2 +- libarchive/test/test_write_format_tar.c | 4 ++-- libarchive/test/test_write_format_tar_sparse.c | 2 +- 12 files changed, 21 insertions(+), 18 deletions(-) (limited to 'libarchive/test') diff --git a/libarchive/test/main.c b/libarchive/test/main.c index f3567d98..f61d16c4 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -128,6 +128,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/main.c 201247 2009-12-30 05:59:21Z # include #endif +/* Path to working directory for current test */ +const char *testworkdir; + #if defined(_WIN32) && !defined(__CYGWIN__) static void *GetFunctionKernel32(const char *); static int my_CreateSymbolicLinkA(const char *, const char *, int); @@ -192,7 +195,7 @@ my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi) } #endif -#if defined(HAVE__CrtSetReportMode) +#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__) static void invalid_parameter_handler(const wchar_t * expression, const wchar_t * function, const wchar_t * file, diff --git a/libarchive/test/test.h b/libarchive/test/test.h index 51c56814..105001c7 100644 --- a/libarchive/test/test.h +++ b/libarchive/test/test.h @@ -315,7 +315,7 @@ void extract_reference_file(const char *); void extract_reference_files(const char **); /* Path to working directory for current test */ -const char *testworkdir; +extern const char *testworkdir; /* * Special interfaces for libarchive test harness. diff --git a/libarchive/test/test_read_data_large.c b/libarchive/test/test_read_data_large.c index 7bb72c01..418020d1 100644 --- a/libarchive/test/test_read_data_large.c +++ b/libarchive/test/test_read_data_large.c @@ -38,9 +38,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_data_large.c 201247 2009- #define close _close #endif -char buff1[11000000]; -char buff2[10000000]; -char buff3[10000000]; +static char buff1[11000000]; +static char buff2[10000000]; +static char buff3[10000000]; DEFINE_TEST(test_read_data_large) { diff --git a/libarchive/test/test_read_truncated.c b/libarchive/test/test_read_truncated.c index 3e665256..3991ab2b 100644 --- a/libarchive/test/test_read_truncated.c +++ b/libarchive/test/test_read_truncated.c @@ -25,8 +25,8 @@ #include "test.h" __FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_truncated.c,v 1.4 2008/09/01 05:38:33 kientzle Exp $"); -char buff[1000000]; -char buff2[100000]; +static char buff[1000000]; +static char buff2[100000]; DEFINE_TEST(test_read_truncated) { diff --git a/libarchive/test/test_write_filter_program.c b/libarchive/test/test_write_filter_program.c index c156b6d5..9fe264c0 100644 --- a/libarchive/test/test_write_filter_program.c +++ b/libarchive/test/test_write_filter_program.c @@ -26,8 +26,8 @@ #include "test.h" __FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_program.c 201247 2009-12-30 05:59:21Z kientzle $"); -char buff[1000000]; -char buff2[64]; +static char buff[1000000]; +static char buff2[64]; DEFINE_TEST(test_write_filter_program) { diff --git a/libarchive/test/test_write_format_ar.c b/libarchive/test/test_write_format_ar.c index 5db75871..058d3b17 100644 --- a/libarchive/test/test_write_format_ar.c +++ b/libarchive/test/test_write_format_ar.c @@ -28,8 +28,8 @@ #include "test.h" __FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_ar.c 189308 2009-03-03 17:02:51Z kientzle $"); -char buff[4096]; -char buff2[64]; +static char buff[4096]; +static char buff2[64]; static char strtab[] = "abcdefghijklmn.o/\nggghhhjjjrrrttt.o/\niiijjjdddsssppp.o/\n"; DEFINE_TEST(test_write_format_ar) diff --git a/libarchive/test/test_write_format_gnutar.c b/libarchive/test/test_write_format_gnutar.c index 67f5a107..63ee6225 100644 --- a/libarchive/test/test_write_format_gnutar.c +++ b/libarchive/test/test_write_format_gnutar.c @@ -25,7 +25,7 @@ #include "test.h" __FBSDID("$FreeBSD$"); -char buff2[64]; +static char buff2[64]; /* Some names 1026 characters long */ static const char *longfilename = "abcdefghijklmnopqrstuvwxyz" diff --git a/libarchive/test/test_write_format_iso9660.c b/libarchive/test/test_write_format_iso9660.c index 9c5a005f..1ea69a18 100644 --- a/libarchive/test/test_write_format_iso9660.c +++ b/libarchive/test/test_write_format_iso9660.c @@ -26,7 +26,7 @@ #include "test.h" __FBSDID("$FreeBSD$"); -char buff2[64]; +static char buff2[64]; DEFINE_TEST(test_write_format_iso9660) { size_t buffsize = 1000000; diff --git a/libarchive/test/test_write_format_iso9660_boot.c b/libarchive/test/test_write_format_iso9660_boot.c index b1f185b9..433f6330 100644 --- a/libarchive/test/test_write_format_iso9660_boot.c +++ b/libarchive/test/test_write_format_iso9660_boot.c @@ -84,7 +84,7 @@ static const unsigned char el_torito_signature[] = { "IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION." }; -char buff2[1024]; +static char buff2[1024]; static void _test_write_format_iso9660_boot(int write_info_tbl) diff --git a/libarchive/test/test_write_format_pax.c b/libarchive/test/test_write_format_pax.c index d29e9adc..1bae0050 100644 --- a/libarchive/test/test_write_format_pax.c +++ b/libarchive/test/test_write_format_pax.c @@ -25,7 +25,7 @@ #include "test.h" __FBSDID("$FreeBSD$"); -char buff2[64]; +static char buff2[64]; DEFINE_TEST(test_write_format_pax) { diff --git a/libarchive/test/test_write_format_tar.c b/libarchive/test/test_write_format_tar.c index 7d16bbfc..3588e8fe 100644 --- a/libarchive/test/test_write_format_tar.c +++ b/libarchive/test/test_write_format_tar.c @@ -25,8 +25,8 @@ #include "test.h" __FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_tar.c 189308 2009-03-03 17:02:51Z kientzle $"); -char buff[1000000]; -char buff2[64]; +static char buff[1000000]; +static char buff2[64]; DEFINE_TEST(test_write_format_tar) { diff --git a/libarchive/test/test_write_format_tar_sparse.c b/libarchive/test/test_write_format_tar_sparse.c index c8e0f479..cc725a9a 100644 --- a/libarchive/test/test_write_format_tar_sparse.c +++ b/libarchive/test/test_write_format_tar_sparse.c @@ -26,7 +26,7 @@ #include "test.h" __FBSDID("$FreeBSD$"); -char buff[1000000]; +static char buff[1000000]; static void test_1(void) -- cgit v1.2.1