From 8297b3faf8606762b176d57637f2ec5f84601e0d Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 4 Dec 2021 21:12:06 +0100 Subject: Fix: unit test and sample program Windows build Now that there is a wrapper for main() on Windows, all executable programs must use a common, cannonical signature for main(). Furthermore, the Windows version of the epoch test needs wrappers for setenv/unsetenv. Signed-off-by: David Oberhollenzer --- tests/libtar/tar_big_file.c | 3 ++- tests/libtar/tar_simple.c | 3 ++- tests/libtar/tar_sparse.c | 3 ++- tests/libtar/tar_sparse_gnu.c | 3 ++- tests/libtar/tar_target_filled.c | 3 ++- tests/libtar/tar_xattr.c | 3 ++- tests/libtar/tar_xattr_bin.c | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) (limited to 'tests/libtar') diff --git a/tests/libtar/tar_big_file.c b/tests/libtar/tar_big_file.c index 69263ef..abea1ef 100644 --- a/tests/libtar/tar_big_file.c +++ b/tests/libtar/tar_big_file.c @@ -8,10 +8,11 @@ #include "tar.h" #include "../test.h" -int main(void) +int main(int argc, char **argv) { tar_header_decoded_t hdr; istream_t *fp; + (void)argc; (void)argv; fp = istream_open_file(STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE)); TEST_NOT_NULL(fp); diff --git a/tests/libtar/tar_simple.c b/tests/libtar/tar_simple.c index ffaafea..54b06c8 100644 --- a/tests/libtar/tar_simple.c +++ b/tests/libtar/tar_simple.c @@ -33,12 +33,13 @@ static const char *fname = static const char *fname = STRVALUE(TESTFNAME); #endif -int main(void) +int main(int argc, char **argv) { tar_header_decoded_t hdr; char buffer[6]; sqfs_s64 ts; istream_t *fp; + (void)argc; (void)argv; fp = istream_open_file(STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE)); TEST_NOT_NULL(fp); diff --git a/tests/libtar/tar_sparse.c b/tests/libtar/tar_sparse.c index c4e1c71..c4313f0 100644 --- a/tests/libtar/tar_sparse.c +++ b/tests/libtar/tar_sparse.c @@ -78,8 +78,9 @@ static void test_case_sparse(const char *path) sqfs_destroy(fp); } -int main(void) +int main(int argc, char **argv) { + (void)argc; (void)argv; test_case_sparse( STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE) ); return EXIT_SUCCESS; } diff --git a/tests/libtar/tar_sparse_gnu.c b/tests/libtar/tar_sparse_gnu.c index 1405026..06f79f1 100644 --- a/tests/libtar/tar_sparse_gnu.c +++ b/tests/libtar/tar_sparse_gnu.c @@ -8,11 +8,12 @@ #include "tar.h" #include "../test.h" -int main(void) +int main(int argc, char **argv) { tar_header_decoded_t hdr; sparse_map_t *sparse; istream_t *fp; + (void)argc; (void)argv; TEST_ASSERT(chdir(TEST_PATH) == 0); diff --git a/tests/libtar/tar_target_filled.c b/tests/libtar/tar_target_filled.c index 0028e5e..f0f4026 100644 --- a/tests/libtar/tar_target_filled.c +++ b/tests/libtar/tar_target_filled.c @@ -8,11 +8,12 @@ #include "tar.h" #include "../test.h" -int main(void) +int main(int argc, char **argv) { tar_header_decoded_t hdr; char buffer[16]; istream_t *fp; + (void)argc; (void)argv; TEST_ASSERT(chdir(TEST_PATH) == 0); diff --git a/tests/libtar/tar_xattr.c b/tests/libtar/tar_xattr.c index 70329fe..633c3a2 100644 --- a/tests/libtar/tar_xattr.c +++ b/tests/libtar/tar_xattr.c @@ -8,11 +8,12 @@ #include "tar.h" #include "../test.h" -int main(void) +int main(int argc, char **argv) { tar_header_decoded_t hdr; char buffer[6]; istream_t *fp; + (void)argc; (void)argv; fp = istream_open_file(STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE)); TEST_NOT_NULL(fp); diff --git a/tests/libtar/tar_xattr_bin.c b/tests/libtar/tar_xattr_bin.c index 52c407c..f44e26f 100644 --- a/tests/libtar/tar_xattr_bin.c +++ b/tests/libtar/tar_xattr_bin.c @@ -16,11 +16,12 @@ static const uint8_t value[] = { 0x00, 0x00, 0x00, 0x00, }; -int main(void) +int main(int argc, char **argv) { tar_header_decoded_t hdr; char buffer[6]; istream_t *fp; + (void)argc; (void)argv; fp = istream_open_file(STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE)); TEST_NOT_NULL(fp); -- cgit v1.2.3