diff options
| author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2022-07-05 15:34:08 +0200 | 
|---|---|---|
| committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2022-07-08 19:17:35 +0200 | 
| commit | d6e2106e96b6969e045251d972e1adcceb9728df (patch) | |
| tree | 6435792bf334cdd1980c071348348f697cf027cb /tests | |
| parent | 4a607edbdfc12f97da0810563fd2e699dcecaa71 (diff) | |
Cleanup: move filename_sane & canonicalize_path functions to libutil
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/libfstree/Makemodule.am | 28 | ||||
| -rw-r--r-- | tests/libfstree/sort_file.c | 1 | ||||
| -rw-r--r-- | tests/libutil/Makemodule.am | 15 | ||||
| -rw-r--r-- | tests/libutil/canonicalize_name.c (renamed from tests/libfstree/canonicalize_name.c) | 2 | ||||
| -rw-r--r-- | tests/libutil/filename_sane.c (renamed from tests/libfstree/filename_sane.c) | 2 | 
5 files changed, 25 insertions, 23 deletions
| diff --git a/tests/libfstree/Makemodule.am b/tests/libfstree/Makemodule.am index a79d670..107a66c 100644 --- a/tests/libfstree/Makemodule.am +++ b/tests/libfstree/Makemodule.am @@ -1,8 +1,5 @@  FSTDATADIR=$(top_srcdir)/tests/libfstree -test_canonicalize_name_SOURCES = tests/libfstree/canonicalize_name.c -test_canonicalize_name_LDADD = libfstree.a libcompat.a -  test_mknode_simple_SOURCES = tests/libfstree/mknode_simple.c  test_mknode_simple_LDADD = libfstree.a libcompat.a @@ -16,7 +13,7 @@ test_mknode_dir_SOURCES = tests/libfstree/mknode_dir.c  test_mknode_dir_LDADD = libfstree.a libcompat.a  test_gen_inode_numbers_SOURCES = tests/libfstree/gen_inode_numbers.c -test_gen_inode_numbers_LDADD = libfstree.a libcompat.a +test_gen_inode_numbers_LDADD = libfstree.a libutil.a libcompat.a  test_add_by_path_SOURCES = tests/libfstree/add_by_path.c  test_add_by_path_LDADD = libfstree.a libcompat.a @@ -31,46 +28,37 @@ test_fstree_sort_LDADD = libfstree.a libio.a libcompat.a  test_fstree_from_file_SOURCES = tests/libfstree/fstree_from_file.c  test_fstree_from_file_CPPFLAGS = $(AM_CPPFLAGS)  test_fstree_from_file_CPPFLAGS += -DTESTPATH=$(FSTDATADIR)/fstree1.txt -test_fstree_from_file_LDADD = libfstree.a libio.a libcompat.a +test_fstree_from_file_LDADD = libfstree.a libio.a libutil.a libcompat.a  test_fstree_glob1_SOURCES = tests/libfstree/fstree_glob1.c  test_fstree_glob1_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(FSTDATADIR) -test_fstree_glob1_LDADD = libfstree.a libio.a libcompat.a +test_fstree_glob1_LDADD = libfstree.a libio.a libutil.a libcompat.a  test_fstree_from_dir_SOURCES = tests/libfstree/fstree_from_dir.c  test_fstree_from_dir_CPPFLAGS = $(AM_CPPFLAGS)  test_fstree_from_dir_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/libtar/data -test_fstree_from_dir_LDADD = libfstree.a libcompat.a +test_fstree_from_dir_LDADD = libfstree.a libutil.a libcompat.a  test_fstree_init_SOURCES = tests/libfstree/fstree_init.c  test_fstree_init_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/lib/fstree  test_fstree_init_LDADD = libfstree.a libio.a libcompat.a -test_filename_sane_SOURCES = tests/libfstree/filename_sane.c -test_filename_sane_SOURCES += lib/fstree/filename_sane.c -test_filename_sane_LDADD = libcompat.a - -test_filename_sane_w32_SOURCES = tests/libfstree/filename_sane.c -test_filename_sane_w32_SOURCES += lib/fstree/filename_sane.c -test_filename_sane_w32_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_WIN32=1 -test_filename_sane_w32_LDADD = libcompat.a -  test_fstree_epoch_SOURCES = tests/libfstree/epoch.c  test_fstree_epoch_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/lib/fstree  test_fstree_epoch_SOURCES += lib/fstree/source_date_epoch.c  test_fstree_epoch_LDADD = libcompat.a  test_sort_file_SOURCES = tests/libfstree/sort_file.c -test_sort_file_LDADD = libfstree.a libio.a libcompat.a +test_sort_file_LDADD = libfstree.a libio.a libutil.a libcompat.a  fstree_fuzz_SOURCES = tests/libfstree/fstree_fuzz.c -fstree_fuzz_LDADD = libfstree.a libio.a libcompat.a +fstree_fuzz_LDADD = libfstree.a libio.a libutil.a libcompat.a  FSTREE_TESTS = \ -	test_canonicalize_name test_mknode_simple test_mknode_slink \ +	test_mknode_simple test_mknode_slink \  	test_mknode_reg test_mknode_dir test_gen_inode_numbers \  	test_add_by_path test_get_path test_fstree_sort test_fstree_from_file \ -	test_fstree_init test_filename_sane test_filename_sane_w32 \ +	test_fstree_init \  	test_fstree_from_dir test_fstree_glob1 test_fstree_epoch \  	test_sort_file diff --git a/tests/libfstree/sort_file.c b/tests/libfstree/sort_file.c index 93d60e0..78d1606 100644 --- a/tests/libfstree/sort_file.c +++ b/tests/libfstree/sort_file.c @@ -9,6 +9,7 @@  #include "sqfs/block.h"  #include "fstree.h"  #include "util/test.h" +#include "util/util.h"  static const char *listing =  "dir /bin 0755 0 0\n" diff --git a/tests/libutil/Makemodule.am b/tests/libutil/Makemodule.am index 95fb8ab..a3853d2 100644 --- a/tests/libutil/Makemodule.am +++ b/tests/libutil/Makemodule.am @@ -15,8 +15,21 @@ test_threadpool_LDADD = libutil.a libcompat.a $(PTHREAD_LIBS)  test_ismemzero_SOURCES = tests/libutil/is_memory_zero.c  test_ismemzero_LDADD = libutil.a libcompat.a +test_canonicalize_name_SOURCES = tests/libutil/canonicalize_name.c +test_canonicalize_name_LDADD = libutil.a libcompat.a + +test_filename_sane_SOURCES = tests/libutil/filename_sane.c +test_filename_sane_SOURCES += lib/util/filename_sane.c +test_filename_sane_LDADD = libcompat.a libutil.a + +test_filename_sane_w32_SOURCES = tests/libutil/filename_sane.c +test_filename_sane_w32_SOURCES += lib/util/filename_sane.c +test_filename_sane_w32_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_WIN32=1 +test_filename_sane_w32_LDADD = libcompat.a +  LIBUTIL_TESTS = \ -	test_str_table test_rbtree test_xxhash test_threadpool test_ismemzero +	test_str_table test_rbtree test_xxhash test_threadpool test_ismemzero \ +	test_canonicalize_name test_filename_sane test_filename_sane_w32  check_PROGRAMS += $(LIBUTIL_TESTS)  TESTS += $(LIBUTIL_TESTS) diff --git a/tests/libfstree/canonicalize_name.c b/tests/libutil/canonicalize_name.c index f117a0d..9f81b04 100644 --- a/tests/libfstree/canonicalize_name.c +++ b/tests/libutil/canonicalize_name.c @@ -5,7 +5,7 @@   * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>   */  #include "config.h" -#include "fstree.h" +#include "util/util.h"  #include "util/test.h"  static const struct { diff --git a/tests/libfstree/filename_sane.c b/tests/libutil/filename_sane.c index a1dc79c..9c9930d 100644 --- a/tests/libfstree/filename_sane.c +++ b/tests/libutil/filename_sane.c @@ -5,7 +5,7 @@   * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>   */  #include "config.h" -#include "fstree.h" +#include "util/util.h"  #include "util/test.h"  static const char *must_work[] = { | 
