aboutsummaryrefslogtreecommitdiff
path: root/lib/tar/test
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-15 16:21:05 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-15 16:39:14 +0200
commit849e6718448793b12d7c6641d59779ca12a2ba08 (patch)
treefa76f15435517cbfdfadef23411f64244a861162 /lib/tar/test
parentd748c7114d2f06378ad0c76b6c981521dbcee92d (diff)
libsquashfs: cleanup the flag situation on istream/ostream functions
- The ostream creation functions already have flag arguments, but make them an sqfs_u32 instead of int. - Add flag arguments to the istream functions, sanitzie and forward them when opening the handle. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar/test')
-rw-r--r--lib/tar/test/tar_big_file.c3
-rw-r--r--lib/tar/test/tar_fuzz.c2
-rw-r--r--lib/tar/test/tar_iterator.c6
-rw-r--r--lib/tar/test/tar_iterator2.c3
-rw-r--r--lib/tar/test/tar_iterator3.c3
-rw-r--r--lib/tar/test/tar_simple.c3
-rw-r--r--lib/tar/test/tar_sparse.c2
-rw-r--r--lib/tar/test/tar_sparse_gnu.c2
-rw-r--r--lib/tar/test/tar_target_filled.c3
-rw-r--r--lib/tar/test/tar_write_simple.c3
-rw-r--r--lib/tar/test/tar_xattr.c3
-rw-r--r--lib/tar/test/tar_xattr_bin.c3
12 files changed, 23 insertions, 13 deletions
diff --git a/lib/tar/test/tar_big_file.c b/lib/tar/test/tar_big_file.c
index 2c8a176..654b6ff 100644
--- a/lib/tar/test/tar_big_file.c
+++ b/lib/tar/test/tar_big_file.c
@@ -17,7 +17,8 @@ int main(int argc, char **argv)
(void)argc; (void)argv;
ret = sqfs_istream_open_file(&fp,
- STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE));
+ STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE),
+ 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
TEST_ASSERT(read_header(fp, &hdr) == 0);
diff --git a/lib/tar/test/tar_fuzz.c b/lib/tar/test/tar_fuzz.c
index 1c4b52e..c09fd2f 100644
--- a/lib/tar/test/tar_fuzz.c
+++ b/lib/tar/test/tar_fuzz.c
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
- ret = sqfs_istream_open_file(&fp, argv[1]);
+ ret = sqfs_istream_open_file(&fp, argv[1], 0);
if (ret) {
sqfs_perror("stdint", NULL, ret);
return EXIT_FAILURE;
diff --git a/lib/tar/test/tar_iterator.c b/lib/tar/test/tar_iterator.c
index d4c2a35..e59b210 100644
--- a/lib/tar/test/tar_iterator.c
+++ b/lib/tar/test/tar_iterator.c
@@ -41,7 +41,8 @@ int main(int argc, char **argv)
/* Open the file, create an iterator */
iret = sqfs_istream_open_file(&fp,
- STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE));
+ STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE),
+ 0);
TEST_EQUAL_I(iret, 0);
TEST_NOT_NULL(fp);
TEST_EQUAL_UI(((sqfs_object_t *)fp)->refcount, 1);
@@ -110,7 +111,8 @@ int main(int argc, char **argv)
/* re-open the tar iterator */
iret = sqfs_istream_open_file(&fp,
- STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE));
+ STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE),
+ 0);
TEST_EQUAL_I(iret, 0);
TEST_NOT_NULL(fp);
it = tar_open_stream(fp);
diff --git a/lib/tar/test/tar_iterator2.c b/lib/tar/test/tar_iterator2.c
index 8bbaf62..ac041fe 100644
--- a/lib/tar/test/tar_iterator2.c
+++ b/lib/tar/test/tar_iterator2.c
@@ -53,7 +53,8 @@ int main(int argc, char **argv)
(void)argc; (void)argv;
iret = sqfs_istream_open_file(&fp,
- STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE));
+ STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE),
+ 0);
TEST_EQUAL_I(iret, 0);
TEST_NOT_NULL(fp);
it = tar_open_stream(fp);
diff --git a/lib/tar/test/tar_iterator3.c b/lib/tar/test/tar_iterator3.c
index 9fd5f59..214fe9c 100644
--- a/lib/tar/test/tar_iterator3.c
+++ b/lib/tar/test/tar_iterator3.c
@@ -23,7 +23,8 @@ int main(int argc, char **argv)
TEST_ASSERT(chdir(TEST_PATH) == 0);
- ret = sqfs_istream_open_file(&fp, "format-acceptance/link_filled.tar");
+ ret = sqfs_istream_open_file(&fp, "format-acceptance/link_filled.tar",
+ 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
TEST_EQUAL_UI(((sqfs_object_t *)fp)->refcount, 1);
diff --git a/lib/tar/test/tar_simple.c b/lib/tar/test/tar_simple.c
index ad9fdde..21ab109 100644
--- a/lib/tar/test/tar_simple.c
+++ b/lib/tar/test/tar_simple.c
@@ -44,7 +44,8 @@ int main(int argc, char **argv)
(void)argc; (void)argv;
ret = sqfs_istream_open_file(&fp,
- STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE));
+ STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE),
+ 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
TEST_ASSERT(read_header(fp, &hdr) == 0);
diff --git a/lib/tar/test/tar_sparse.c b/lib/tar/test/tar_sparse.c
index 49b2064..702db58 100644
--- a/lib/tar/test/tar_sparse.c
+++ b/lib/tar/test/tar_sparse.c
@@ -16,7 +16,7 @@ static void test_case_sparse(const char *path)
sqfs_istream_t *fp;
int ret;
- ret = sqfs_istream_open_file(&fp, path);
+ ret = sqfs_istream_open_file(&fp, path, 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
TEST_ASSERT(read_header(fp, &hdr) == 0);
diff --git a/lib/tar/test/tar_sparse_gnu.c b/lib/tar/test/tar_sparse_gnu.c
index a2f8332..1f928bd 100644
--- a/lib/tar/test/tar_sparse_gnu.c
+++ b/lib/tar/test/tar_sparse_gnu.c
@@ -19,7 +19,7 @@ int main(int argc, char **argv)
TEST_ASSERT(chdir(TEST_PATH) == 0);
- ret = sqfs_istream_open_file(&fp, "sparse-files/gnu-small.tar");
+ ret = sqfs_istream_open_file(&fp, "sparse-files/gnu-small.tar", 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
TEST_ASSERT(read_header(fp, &hdr) == 0);
diff --git a/lib/tar/test/tar_target_filled.c b/lib/tar/test/tar_target_filled.c
index 93c3b02..1279edf 100644
--- a/lib/tar/test/tar_target_filled.c
+++ b/lib/tar/test/tar_target_filled.c
@@ -19,7 +19,8 @@ int main(int argc, char **argv)
TEST_ASSERT(chdir(TEST_PATH) == 0);
- ret = sqfs_istream_open_file(&fp, "format-acceptance/link_filled.tar");
+ ret = sqfs_istream_open_file(&fp, "format-acceptance/link_filled.tar",
+ 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
diff --git a/lib/tar/test/tar_write_simple.c b/lib/tar/test/tar_write_simple.c
index bc1b93e..438ea37 100644
--- a/lib/tar/test/tar_write_simple.c
+++ b/lib/tar/test/tar_write_simple.c
@@ -188,7 +188,8 @@ int main(int argc, char **argv)
TEST_EQUAL_UI(sizeof(rd_buffer), sizeof(wr_buffer));
ret = sqfs_istream_open_file(&fp,
- STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE));
+ STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE),
+ 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
diff --git a/lib/tar/test/tar_xattr.c b/lib/tar/test/tar_xattr.c
index d074e31..ca15c66 100644
--- a/lib/tar/test/tar_xattr.c
+++ b/lib/tar/test/tar_xattr.c
@@ -19,7 +19,8 @@ int main(int argc, char **argv)
(void)argc; (void)argv;
ret = sqfs_istream_open_file(&fp,
- STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE));
+ STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE),
+ 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
TEST_ASSERT(read_header(fp, &hdr) == 0);
diff --git a/lib/tar/test/tar_xattr_bin.c b/lib/tar/test/tar_xattr_bin.c
index 68f23fe..901b657 100644
--- a/lib/tar/test/tar_xattr_bin.c
+++ b/lib/tar/test/tar_xattr_bin.c
@@ -27,7 +27,8 @@ int main(int argc, char **argv)
(void)argc; (void)argv;
ret = sqfs_istream_open_file(&fp,
- STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE));
+ STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE),
+ 0);
TEST_EQUAL_I(ret, 0);
TEST_NOT_NULL(fp);
TEST_ASSERT(read_header(fp, &hdr) == 0);