From: Jiri Malak Date: Wed, 12 Mar 2014 07:50:51 +0000 (+0100) Subject: fixes for test programs to be buildable by Open Watcom X-Git-Tag: v3.1.900a~314^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F67%2Fhead;p=thirdparty%2Flibarchive.git fixes for test programs to be buildable by Open Watcom correct buffers to be realy local for each test as expected by logic --- diff --git a/cpio/test/main.c b/cpio/test/main.c index d4c6e5c33..f83661637 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -130,6 +130,14 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.3 2008/08/24 04:58:22 kient # include #endif +/* Path to working directory for current test */ +const char *testworkdir; +/* Pathname of exe to be tested. */ +const char *testprogfile; +/* Name of exe to use in printf-formatted command strings. */ +/* On Windows, this includes leading/trailing quotes. */ +const char *testprog; + #if defined(_WIN32) && !defined(__CYGWIN__) static void *GetFunctionKernel32(const char *); static int my_CreateSymbolicLinkA(const char *, const char *, int); @@ -194,7 +202,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, @@ -2515,7 +2523,7 @@ main(int argc, char **argv) while (pwd[strlen(pwd) - 1] == '\n') pwd[strlen(pwd) - 1] = '\0'; -#if defined(HAVE__CrtSetReportMode) +#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__) /* To stop to run the default invalid parameter handler. */ _set_invalid_parameter_handler(invalid_parameter_handler); /* Disable annoying assertion message box. */ diff --git a/cpio/test/test.h b/cpio/test/test.h index 27813e1e5..41ab019b2 100644 --- a/cpio/test/test.h +++ b/cpio/test/test.h @@ -305,17 +305,17 @@ char *slurpfile(size_t *, const char *fmt, ...); void extract_reference_file(const char *); /* Path to working directory for current test */ -const char *testworkdir; +extern const char *testworkdir; /* * Special interfaces for program test harness. */ /* Pathname of exe to be tested. */ -const char *testprogfile; +extern const char *testprogfile; /* Name of exe to use in printf-formatted command strings. */ /* On Windows, this includes leading/trailing quotes. */ -const char *testprog; +extern const char *testprog; #ifdef USE_DMALLOC #include diff --git a/libarchive/test/main.c b/libarchive/test/main.c index f3567d982..f61d16c4c 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 51c56814c..105001c7c 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 7bb72c01e..418020d11 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 3e6652567..3991ab2ba 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 c156b6d55..9fe264c01 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 5db75871c..058d3b178 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 67f5a107c..63ee6225f 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 9c5a005fd..1ea69a183 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 b1f185b9c..433f63309 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 d29e9adcd..1bae0050f 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 7d16bbfc6..3588e8fe2 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 c8e0f4797..cc725a9a7 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) diff --git a/tar/test/main.c b/tar/test/main.c index face5ca36..b92ef2c7d 100644 --- a/tar/test/main.c +++ b/tar/test/main.c @@ -130,6 +130,14 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.6 2008/11/05 06:40:53 kientz # include #endif +/* Path to working directory for current test */ +const char *testworkdir; +/* Pathname of exe to be tested. */ +const char *testprogfile; +/* Name of exe to use in printf-formatted command strings. */ +/* On Windows, this includes leading/trailing quotes. */ +const char *testprog; + #if defined(_WIN32) && !defined(__CYGWIN__) static void *GetFunctionKernel32(const char *); static int my_CreateSymbolicLinkA(const char *, const char *, int); @@ -194,7 +202,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/tar/test/test.h b/tar/test/test.h index 0ef255f76..743321954 100644 --- a/tar/test/test.h +++ b/tar/test/test.h @@ -307,17 +307,17 @@ char *slurpfile(size_t *, const char *fmt, ...); void extract_reference_file(const char *); /* Path to working directory for current test */ -const char *testworkdir; +extern const char *testworkdir; /* * Special interfaces for program test harness. */ /* Pathname of exe to be tested. */ -const char *testprogfile; +extern const char *testprogfile; /* Name of exe to use in printf-formatted command strings. */ /* On Windows, this includes leading/trailing quotes. */ -const char *testprog; +extern const char *testprog; #ifdef USE_DMALLOC #include