diff options
Diffstat (limited to 'bin/gensquashfs/test')
-rw-r--r-- | bin/gensquashfs/test/fstree_from_file.c | 6 | ||||
-rw-r--r-- | bin/gensquashfs/test/fstree_from_file2.c | 5 | ||||
-rw-r--r-- | bin/gensquashfs/test/fstree_glob1.c | 10 | ||||
-rw-r--r-- | bin/gensquashfs/test/sort_file.c | 5 |
4 files changed, 20 insertions, 6 deletions
diff --git a/bin/gensquashfs/test/fstree_from_file.c b/bin/gensquashfs/test/fstree_from_file.c index a5500dc..bbd1c09 100644 --- a/bin/gensquashfs/test/fstree_from_file.c +++ b/bin/gensquashfs/test/fstree_from_file.c @@ -27,15 +27,19 @@ int main(int argc, char **argv) fstree_defaults_t fsd; sqfs_istream_t *file; tree_node_t *n; + options_t opt; fstree_t fs; (void)argc; (void)argv; + memset(&opt, 0, sizeof(opt)); + opt.dirscan_flags = DIR_SCAN_KEEP_UID | DIR_SCAN_KEEP_GID; + file = istream_memory_create("memfile", 7, listing, strlen(listing)); TEST_NOT_NULL(file); TEST_ASSERT(parse_fstree_defaults(&fsd, NULL) == 0); TEST_ASSERT(fstree_init(&fs, &fsd) == 0); - TEST_ASSERT(fstree_from_file_stream(&fs, file, NULL) == 0); + TEST_ASSERT(fstree_from_file_stream(&fs, file, &opt) == 0); sqfs_drop(file); fstree_post_process(&fs); diff --git a/bin/gensquashfs/test/fstree_from_file2.c b/bin/gensquashfs/test/fstree_from_file2.c index ab372c9..3f9561b 100644 --- a/bin/gensquashfs/test/fstree_from_file2.c +++ b/bin/gensquashfs/test/fstree_from_file2.c @@ -22,15 +22,18 @@ int main(int argc, char **argv) fstree_defaults_t fsd; sqfs_istream_t *file; tree_node_t *n; + options_t opt; fstree_t fs; (void)argc; (void)argv; + memset(&opt, 0, sizeof(opt)); + file = istream_memory_create("memfile", 7, listing, strlen(listing)); TEST_NOT_NULL(file); TEST_ASSERT(parse_fstree_defaults(&fsd, NULL) == 0); TEST_ASSERT(fstree_init(&fs, &fsd) == 0); - TEST_ASSERT(fstree_from_file_stream(&fs, file, NULL) == 0); + TEST_ASSERT(fstree_from_file_stream(&fs, file, &opt) == 0); sqfs_drop(file); fstree_post_process(&fs); diff --git a/bin/gensquashfs/test/fstree_glob1.c b/bin/gensquashfs/test/fstree_glob1.c index 315ab74..58686fd 100644 --- a/bin/gensquashfs/test/fstree_glob1.c +++ b/bin/gensquashfs/test/fstree_glob1.c @@ -269,17 +269,21 @@ static void check_hierarchy(tree_node_t *root, bool subdir, bool recursive) int main(int argc, char **argv) { fstree_defaults_t fsd; + options_t opt; fstree_t fs; int ret; (void)argc; (void)argv; TEST_ASSERT(parse_fstree_defaults(&fsd, NULL) == 0); + memset(&opt, 0, sizeof(opt)); + opt.packdir = (char *)TEST_PATH; + /* first test case, directory tree only */ ret = fstree_init(&fs, &fsd); TEST_EQUAL_I(ret, 0); - ret = fstree_from_file(&fs, TEST_PATH "/fstree_glob1.txt", TEST_PATH); + ret = fstree_from_file(&fs, TEST_PATH "/fstree_glob1.txt", &opt); TEST_EQUAL_I(ret, 0); fstree_post_process(&fs); @@ -290,7 +294,7 @@ int main(int argc, char **argv) ret = fstree_init(&fs, &fsd); TEST_EQUAL_I(ret, 0); - ret = fstree_from_file(&fs, TEST_PATH "/fstree_glob2.txt", TEST_PATH); + ret = fstree_from_file(&fs, TEST_PATH "/fstree_glob2.txt", &opt); TEST_EQUAL_I(ret, 0); fstree_post_process(&fs); @@ -301,7 +305,7 @@ int main(int argc, char **argv) ret = fstree_init(&fs, &fsd); TEST_EQUAL_I(ret, 0); - ret = fstree_from_file(&fs, TEST_PATH "/fstree_glob3.txt", TEST_PATH); + ret = fstree_from_file(&fs, TEST_PATH "/fstree_glob3.txt", &opt); TEST_EQUAL_I(ret, 0); fstree_post_process(&fs); diff --git a/bin/gensquashfs/test/sort_file.c b/bin/gensquashfs/test/sort_file.c index 063f95d..828548a 100644 --- a/bin/gensquashfs/test/sort_file.c +++ b/bin/gensquashfs/test/sort_file.c @@ -114,17 +114,20 @@ int main(int argc, char **argv) sqfs_istream_t *memstream; fstree_defaults_t fsd; tree_node_t *n; + options_t opt; fstree_t fs; size_t i; (void)argc; (void)argv; + memset(&opt, 0, sizeof(opt)); + memstream = istream_memory_create("listing.txt", 1024, listing, strlen(listing)); TEST_NOT_NULL(memstream); TEST_ASSERT(parse_fstree_defaults(&fsd, NULL) == 0); TEST_ASSERT(fstree_init(&fs, &fsd) == 0); - TEST_ASSERT(fstree_from_file_stream(&fs, memstream, NULL) == 0); + TEST_ASSERT(fstree_from_file_stream(&fs, memstream, &opt) == 0); sqfs_drop(memstream); fstree_post_process(&fs); |