summaryrefslogtreecommitdiff
path: root/tests/libsqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-12-04 21:12:06 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-12-05 10:32:01 +0100
commit8297b3faf8606762b176d57637f2ec5f84601e0d (patch)
tree0b30ab78333f6f04adb1ab1ed56113246a17198e /tests/libsqfs
parent2b8eb19a4de81db470f7ff5021a8a4822cc8c80d (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/libsqfs')
-rw-r--r--tests/libsqfs/Makemodule.am6
-rw-r--r--tests/libsqfs/abi.c3
-rw-r--r--tests/libsqfs/table.c3
-rw-r--r--tests/libsqfs/xattr_writer.c3
4 files changed, 9 insertions, 6 deletions
diff --git a/tests/libsqfs/Makemodule.am b/tests/libsqfs/Makemodule.am
index 33567b0..514571d 100644
--- a/tests/libsqfs/Makemodule.am
+++ b/tests/libsqfs/Makemodule.am
@@ -1,11 +1,11 @@
test_abi_SOURCES = tests/libsqfs/abi.c tests/test.h
-test_abi_LDADD = libsquashfs.la
+test_abi_LDADD = libsquashfs.la libcompat.a
test_table_SOURCES = tests/libsqfs/table.c tests/test.h
-test_table_LDADD = libsquashfs.la
+test_table_LDADD = libsquashfs.la libcompat.a
test_xattr_writer_SOURCES = tests/libsqfs/xattr_writer.c tests/test.h
-test_xattr_writer_LDADD = libsquashfs.la
+test_xattr_writer_LDADD = libsquashfs.la libcompat.a
xattr_benchmark_SOURCES = tests/libsqfs/xattr_benchmark.c
xattr_benchmark_LDADD = libcommon.a libsquashfs.la libcompat.a
diff --git a/tests/libsqfs/abi.c b/tests/libsqfs/abi.c
index d409f67..3bdc4f5 100644
--- a/tests/libsqfs/abi.c
+++ b/tests/libsqfs/abi.c
@@ -163,8 +163,9 @@ static void test_blockproc_desc(void)
(4 * sizeof(sqfs_u32) + 4 * sizeof(void *)));
}
-int main(void)
+int main(int argc, char **argv)
{
+ (void)argc; (void)argv;
test_compressor_opt_struct();
test_compressor_names();
test_blockproc_stats();
diff --git a/tests/libsqfs/table.c b/tests/libsqfs/table.c
index 0b1ab93..5f240cc 100644
--- a/tests/libsqfs/table.c
+++ b/tests/libsqfs/table.c
@@ -111,12 +111,13 @@ static sqfs_compressor_t dummy_uncompressor = {
static sqfs_u64 table[4000];
-int main(void)
+int main(int argc, char **argv)
{
sqfs_u64 start, value, locations[4], *copy;
sqfs_u16 hdr;
size_t i;
int ret;
+ (void)argc; (void)argv;
/* fill the table with data */
for (i = 0; i < sizeof(table) / sizeof(table[0]); ++i)
diff --git a/tests/libsqfs/xattr_writer.c b/tests/libsqfs/xattr_writer.c
index 8860f42..6fa0355 100644
--- a/tests/libsqfs/xattr_writer.c
+++ b/tests/libsqfs/xattr_writer.c
@@ -71,7 +71,7 @@ static sqfs_compressor_t dummy_compressor = {
/*****************************************************************************/
-int main(void)
+int main(int argc, char **argv)
{
size_t offset, ool_value_offset, id_offset;
sqfs_xattr_id_table_t idtbl;
@@ -85,6 +85,7 @@ int main(void)
sqfs_u64 ref;
sqfs_u32 id;
int ret;
+ (void)argc; (void)argv;
/* setup */
xwr = sqfs_xattr_writer_create(0);