diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-09-23 11:16:46 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-10-24 15:57:18 +0200 |
commit | 9f2d63162e82d423faeda9c7449d6edd819e4591 (patch) | |
tree | fa22cd6a89655ef9726c64336be47a209bac1a15 /lib | |
parent | ee26abcab9faf037cf87438cca20d54e5b0edd05 (diff) |
Move the directory iterator test to libsquashfs, move the tree
scanning code to libcommon.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common/Makemodule.am | 21 | ||||
-rw-r--r-- | lib/common/src/dir_tree_iterator.c (renamed from lib/io/src/dir_tree_iterator.c) | 2 | ||||
-rw-r--r-- | lib/common/test/dir_tree_iterator.c (renamed from lib/io/test/dir_tree_iterator.c) | 3 | ||||
-rw-r--r-- | lib/common/test/dir_tree_iterator2.c (renamed from lib/io/test/dir_tree_iterator2.c) | 3 | ||||
-rw-r--r-- | lib/common/test/dir_tree_iterator3.c (renamed from lib/io/test/dir_tree_iterator3.c) | 3 | ||||
-rw-r--r-- | lib/io/Makemodule.am | 34 | ||||
-rw-r--r-- | lib/sqfs/Makemodule.am | 9 | ||||
-rw-r--r-- | lib/sqfs/test/dir_iterator.c (renamed from lib/io/test/dir_iterator.c) | 2 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dira/file_a0 (renamed from lib/io/test/testdir/dira/file_a0) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dira/file_a1 (renamed from lib/io/test/testdir/dira/file_a1) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dira/file_a2 (renamed from lib/io/test/testdir/dira/file_a2) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirb/dirx/file_x0 (renamed from lib/io/test/testdir/dirb/dirx/file_x0) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirb/dirx/file_x1 (renamed from lib/io/test/testdir/dirb/dirx/file_x1) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirb/dirx/file_x2 (renamed from lib/io/test/testdir/dirb/dirx/file_x2) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirb/file_b0 (renamed from lib/io/test/testdir/dirb/file_b0) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirb/file_b1 (renamed from lib/io/test/testdir/dirb/file_b1) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirb/file_b2 (renamed from lib/io/test/testdir/dirb/file_b2) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirc/file_c0 (renamed from lib/io/test/testdir/dirc/file_c0) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirc/file_c1 (renamed from lib/io/test/testdir/dirc/file_c1) | 0 | ||||
-rw-r--r-- | lib/sqfs/test/testdir/dirc/file_c2 (renamed from lib/io/test/testdir/dirc/file_c2) | 0 | ||||
-rw-r--r-- | lib/tar/src/iterator.c | 1 | ||||
-rw-r--r-- | lib/tar/test/tar_iterator.c | 1 | ||||
-rw-r--r-- | lib/tar/test/tar_iterator2.c | 1 | ||||
-rw-r--r-- | lib/tar/test/tar_iterator3.c | 1 | ||||
-rw-r--r-- | lib/tar/test/tar_write_simple.c | 1 |
25 files changed, 40 insertions, 42 deletions
diff --git a/lib/common/Makemodule.am b/lib/common/Makemodule.am index 9438d3a..5230fcf 100644 --- a/lib/common/Makemodule.am +++ b/lib/common/Makemodule.am @@ -7,7 +7,8 @@ libcommon_a_SOURCES = include/common.h include/simple_writer.h \ lib/common/src/writer/serialize_fstree.c lib/common/src/writer/finish.c\ lib/common/src/fstree_cli.c lib/common/src/perror.c \ lib/common/src/dir_tree.c lib/common/src/read_tree.c \ - lib/common/src/stream.c + lib/common/src/stream.c lib/common/src/dir_tree_iterator.c \ + include/dir_tree_iterator.h lib/common/src/dir_tree_iterator.c libcommon_a_CFLAGS = $(AM_CFLAGS) $(LZO_CFLAGS) if WITH_LZO @@ -26,8 +27,24 @@ test_fstree_cli_LDADD = libcommon.a libutil.a libcompat.a test_get_node_path_SOURCES = lib/common/test/get_node_path.c test_get_node_path_LDADD = libcommon.a libsquashfs.la libcompat.a +test_dir_tree_iterator_SOURCES = lib/common/test/dir_tree_iterator.c +test_dir_tree_iterator_LDADD = libcommon.a libsquashfs.la libutil.a libcompat.a +test_dir_tree_iterator_CPPFLAGS = $(AM_CPPFLAGS) +test_dir_tree_iterator_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/sqfs/test/testdir + +test_dir_tree_iterator2_SOURCES = lib/common/test/dir_tree_iterator2.c +test_dir_tree_iterator2_LDADD = libcommon.a libsquashfs.la libutil.a libcompat.a +test_dir_tree_iterator2_CPPFLAGS = $(AM_CPPFLAGS) +test_dir_tree_iterator2_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/sqfs/test/testdir + +test_dir_tree_iterator3_SOURCES = lib/common/test/dir_tree_iterator3.c +test_dir_tree_iterator3_LDADD = libcommon.a libsquashfs.la libutil.a libcompat.a +test_dir_tree_iterator3_CPPFLAGS = $(AM_CPPFLAGS) +test_dir_tree_iterator3_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/sqfs/test/testdir + LIBCOMMON_TESTS = \ - test_istream_mem test_fstree_cli test_get_node_path + test_istream_mem test_fstree_cli test_get_node_path \ + test_dir_tree_iterator test_dir_tree_iterator2 test_dir_tree_iterator3 check_PROGRAMS += $(LIBCOMMON_TESTS) TESTS += $(LIBCOMMON_TESTS) diff --git a/lib/io/src/dir_tree_iterator.c b/lib/common/src/dir_tree_iterator.c index 5688489..f161507 100644 --- a/lib/io/src/dir_tree_iterator.c +++ b/lib/common/src/dir_tree_iterator.c @@ -5,7 +5,7 @@ * Copyright (C) 2023 David Oberhollenzer <goliath@infraroot.at> */ #include "config.h" -#include "io/dir_iterator.h" +#include "dir_tree_iterator.h" #include "util/util.h" #include "sqfs/error.h" #include "sqfs/io.h" diff --git a/lib/io/test/dir_tree_iterator.c b/lib/common/test/dir_tree_iterator.c index 6c7f1bf..2a065d8 100644 --- a/lib/io/test/dir_tree_iterator.c +++ b/lib/common/test/dir_tree_iterator.c @@ -6,11 +6,12 @@ */ #include "config.h" -#include "io/dir_iterator.h" +#include "dir_tree_iterator.h" #include "sqfs/error.h" #include "util/test.h" #include "sqfs/io.h" #include "compat.h" +#include "common.h" static int compare_entries(const void *a, const void *b) { diff --git a/lib/io/test/dir_tree_iterator2.c b/lib/common/test/dir_tree_iterator2.c index 9184957..4d92260 100644 --- a/lib/io/test/dir_tree_iterator2.c +++ b/lib/common/test/dir_tree_iterator2.c @@ -6,11 +6,12 @@ */ #include "config.h" -#include "io/dir_iterator.h" +#include "dir_tree_iterator.h" #include "sqfs/error.h" #include "util/test.h" #include "sqfs/io.h" #include "compat.h" +#include "common.h" static int compare_entries(const void *a, const void *b) { diff --git a/lib/io/test/dir_tree_iterator3.c b/lib/common/test/dir_tree_iterator3.c index ccb6bdb..612a7eb 100644 --- a/lib/io/test/dir_tree_iterator3.c +++ b/lib/common/test/dir_tree_iterator3.c @@ -6,11 +6,12 @@ */ #include "config.h" -#include "io/dir_iterator.h" +#include "dir_tree_iterator.h" #include "sqfs/error.h" #include "util/test.h" #include "sqfs/io.h" #include "compat.h" +#include "common.h" static int compare_entries(const void *a, const void *b) { diff --git a/lib/io/Makemodule.am b/lib/io/Makemodule.am deleted file mode 100644 index 75a3e59..0000000 --- a/lib/io/Makemodule.am +++ /dev/null @@ -1,34 +0,0 @@ -libio_a_SOURCES = include/io/dir_iterator.h \ - lib/io/src/dir_tree_iterator.c -libio_a_CFLAGS = $(AM_CFLAGS) $(ZLIB_CFLAGS) $(XZ_CFLAGS) -libio_a_CFLAGS += $(ZSTD_CFLAGS) $(BZIP2_CFLAGS) - -noinst_LIBRARIES += libio.a - -LIBIO_TESTS = test_dir_iterator \ - test_dir_tree_iterator test_dir_tree_iterator2 test_dir_tree_iterator3 - -test_dir_iterator_SOURCES = lib/io/test/dir_iterator.c -test_dir_iterator_LDADD = libio.a libsquashfs.la libutil.a libcompat.a -test_dir_iterator_CPPFLAGS = $(AM_CPPFLAGS) -test_dir_iterator_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/io/test/testdir - -test_dir_tree_iterator_SOURCES = lib/io/test/dir_tree_iterator.c -test_dir_tree_iterator_LDADD = libio.a libsquashfs.la libutil.a libcompat.a -test_dir_tree_iterator_CPPFLAGS = $(AM_CPPFLAGS) -test_dir_tree_iterator_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/io/test/testdir - -test_dir_tree_iterator2_SOURCES = lib/io/test/dir_tree_iterator2.c -test_dir_tree_iterator2_LDADD = libio.a libsquashfs.la libutil.a libcompat.a -test_dir_tree_iterator2_CPPFLAGS = $(AM_CPPFLAGS) -test_dir_tree_iterator2_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/io/test/testdir - -test_dir_tree_iterator3_SOURCES = lib/io/test/dir_tree_iterator3.c -test_dir_tree_iterator3_LDADD = libio.a libsquashfs.la libutil.a libcompat.a -test_dir_tree_iterator3_CPPFLAGS = $(AM_CPPFLAGS) -test_dir_tree_iterator3_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/io/test/testdir - -check_PROGRAMS += $(LIBIO_TESTS) -TESTS += $(LIBIO_TESTS) - -EXTRA_DIST += $(top_srcdir)/lib/io/test/testdir diff --git a/lib/sqfs/Makemodule.am b/lib/sqfs/Makemodule.am index 41ea608..df0b21a 100644 --- a/lib/sqfs/Makemodule.am +++ b/lib/sqfs/Makemodule.am @@ -139,11 +139,18 @@ test_rec_dir_LDADD = libsquashfs.la libutil.a libcompat.a test_hl_dir_SOURCES = lib/sqfs/test/hl_dir.c test_hl_dir_LDADD = libsquashfs.la libutil.a libcompat.a +test_dir_iterator_SOURCES = lib/sqfs/test/dir_iterator.c +test_dir_iterator_LDADD = libsquashfs.la libutil.a libcompat.a +test_dir_iterator_CPPFLAGS = $(AM_CPPFLAGS) +test_dir_iterator_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/sqfs/test/testdir + LIBSQFS_TESTS = \ test_abi test_xattr test_table test_xattr_writer \ test_istream_read test_istream_skip test_stream_splice test_rec_dir \ - test_hl_dir + test_hl_dir test_dir_iterator noinst_PROGRAMS += xattr_benchmark check_PROGRAMS += $(LIBSQFS_TESTS) TESTS += $(LIBSQFS_TESTS) + +EXTRA_DIST += $(top_srcdir)/lib/sqfs/test/testdir diff --git a/lib/io/test/dir_iterator.c b/lib/sqfs/test/dir_iterator.c index 56610b6..701b8f0 100644 --- a/lib/io/test/dir_iterator.c +++ b/lib/sqfs/test/dir_iterator.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "io/dir_iterator.h" +#include "sqfs/dir_entry.h" #include "sqfs/error.h" #include "util/test.h" #include "sqfs/io.h" diff --git a/lib/io/test/testdir/dira/file_a0 b/lib/sqfs/test/testdir/dira/file_a0 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dira/file_a0 +++ b/lib/sqfs/test/testdir/dira/file_a0 diff --git a/lib/io/test/testdir/dira/file_a1 b/lib/sqfs/test/testdir/dira/file_a1 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dira/file_a1 +++ b/lib/sqfs/test/testdir/dira/file_a1 diff --git a/lib/io/test/testdir/dira/file_a2 b/lib/sqfs/test/testdir/dira/file_a2 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dira/file_a2 +++ b/lib/sqfs/test/testdir/dira/file_a2 diff --git a/lib/io/test/testdir/dirb/dirx/file_x0 b/lib/sqfs/test/testdir/dirb/dirx/file_x0 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dirb/dirx/file_x0 +++ b/lib/sqfs/test/testdir/dirb/dirx/file_x0 diff --git a/lib/io/test/testdir/dirb/dirx/file_x1 b/lib/sqfs/test/testdir/dirb/dirx/file_x1 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dirb/dirx/file_x1 +++ b/lib/sqfs/test/testdir/dirb/dirx/file_x1 diff --git a/lib/io/test/testdir/dirb/dirx/file_x2 b/lib/sqfs/test/testdir/dirb/dirx/file_x2 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dirb/dirx/file_x2 +++ b/lib/sqfs/test/testdir/dirb/dirx/file_x2 diff --git a/lib/io/test/testdir/dirb/file_b0 b/lib/sqfs/test/testdir/dirb/file_b0 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dirb/file_b0 +++ b/lib/sqfs/test/testdir/dirb/file_b0 diff --git a/lib/io/test/testdir/dirb/file_b1 b/lib/sqfs/test/testdir/dirb/file_b1 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dirb/file_b1 +++ b/lib/sqfs/test/testdir/dirb/file_b1 diff --git a/lib/io/test/testdir/dirb/file_b2 b/lib/sqfs/test/testdir/dirb/file_b2 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dirb/file_b2 +++ b/lib/sqfs/test/testdir/dirb/file_b2 diff --git a/lib/io/test/testdir/dirc/file_c0 b/lib/sqfs/test/testdir/dirc/file_c0 index 71c1922..71c1922 100644 --- a/lib/io/test/testdir/dirc/file_c0 +++ b/lib/sqfs/test/testdir/dirc/file_c0 diff --git a/lib/io/test/testdir/dirc/file_c1 b/lib/sqfs/test/testdir/dirc/file_c1 index e69de29..e69de29 100644 --- a/lib/io/test/testdir/dirc/file_c1 +++ b/lib/sqfs/test/testdir/dirc/file_c1 diff --git a/lib/io/test/testdir/dirc/file_c2 b/lib/sqfs/test/testdir/dirc/file_c2 index efde6ef..efde6ef 100644 --- a/lib/io/test/testdir/dirc/file_c2 +++ b/lib/sqfs/test/testdir/dirc/file_c2 diff --git a/lib/tar/src/iterator.c b/lib/tar/src/iterator.c index 8f3353e..570f687 100644 --- a/lib/tar/src/iterator.c +++ b/lib/tar/src/iterator.c @@ -12,6 +12,7 @@ #include "util/util.h" #include "xfrm/wrap.h" #include "compat.h" +#include "sqfs/dir_entry.h" #include <stdlib.h> #include <string.h> diff --git a/lib/tar/test/tar_iterator.c b/lib/tar/test/tar_iterator.c index b90d5ca..4e89380 100644 --- a/lib/tar/test/tar_iterator.c +++ b/lib/tar/test/tar_iterator.c @@ -9,6 +9,7 @@ #include "util/test.h" #include "sqfs/error.h" #include "sqfs/io.h" +#include "sqfs/dir_entry.h" #ifndef TESTUID #define TESTUID 1000 diff --git a/lib/tar/test/tar_iterator2.c b/lib/tar/test/tar_iterator2.c index 630f579..e983c27 100644 --- a/lib/tar/test/tar_iterator2.c +++ b/lib/tar/test/tar_iterator2.c @@ -8,6 +8,7 @@ #include "tar/tar.h" #include "util/test.h" #include "sqfs/io.h" +#include "sqfs/dir_entry.h" static const struct { uint64_t offset; diff --git a/lib/tar/test/tar_iterator3.c b/lib/tar/test/tar_iterator3.c index 05940a2..e9bb472 100644 --- a/lib/tar/test/tar_iterator3.c +++ b/lib/tar/test/tar_iterator3.c @@ -10,6 +10,7 @@ #include "util/test.h" #include "sqfs/error.h" #include "sqfs/io.h" +#include "sqfs/dir_entry.h" int main(int argc, char **argv) { diff --git a/lib/tar/test/tar_write_simple.c b/lib/tar/test/tar_write_simple.c index c82fe08..225841e 100644 --- a/lib/tar/test/tar_write_simple.c +++ b/lib/tar/test/tar_write_simple.c @@ -9,6 +9,7 @@ #include "sqfs/io.h" #include "util/test.h" #include "sqfs/xattr.h" +#include "sqfs/dir_entry.h" #include "compat.h" static void hex_dump(const sqfs_u8 *data, size_t size) |