summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makemodule.am8
-rw-r--r--tests/gen_inode_numbers.c (renamed from tests/gen_inode_table.c)15
2 files changed, 8 insertions, 15 deletions
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
index fc27de0..2fb7654 100644
--- a/tests/Makemodule.am
+++ b/tests/Makemodule.am
@@ -27,8 +27,8 @@ test_mknode_reg_LDADD = libfstree.a libcompat.a
test_mknode_dir_SOURCES = tests/mknode_dir.c
test_mknode_dir_LDADD = libfstree.a libcompat.a
-test_gen_inode_table_SOURCES = tests/gen_inode_table.c
-test_gen_inode_table_LDADD = libfstree.a libcompat.a
+test_gen_inode_numbers_SOURCES = tests/gen_inode_numbers.c
+test_gen_inode_numbers_LDADD = libfstree.a libcompat.a
test_add_by_path_SOURCES = tests/add_by_path.c
test_add_by_path_LDADD = libfstree.a libcompat.a
@@ -93,7 +93,7 @@ tar_fuzz_SOURCES = tests/tar_fuzz.c
tar_fuzz_LDADD = libtar.a libcompat.a
check_PROGRAMS += test_mknode_simple test_mknode_slink test_mknode_reg
-check_PROGRAMS += test_mknode_dir test_gen_inode_table test_add_by_path
+check_PROGRAMS += test_mknode_dir test_gen_inode_numbers test_add_by_path
check_PROGRAMS += test_get_path test_fstree_sort test_fstree_from_file
check_PROGRAMS += test_fstree_init test_tar_ustar test_tar_pax test_tar_gnu
check_PROGRAMS += test_tar_sparse_gnu test_tar_sparse_gnu1 test_tar_sparse_gnu2
@@ -104,7 +104,7 @@ check_SCRIPTS += tests/cantrbry.sh tests/test_tar_sqfs.sh
noinst_PROGRAMS += fstree_fuzz tar_fuzz
TESTS += test_mknode_simple test_mknode_slink
-TESTS += test_mknode_reg test_mknode_dir test_gen_inode_table
+TESTS += test_mknode_reg test_mknode_dir test_gen_inode_numbers
TESTS += test_add_by_path test_get_path test_fstree_sort test_fstree_from_file
TESTS += test_fstree_init test_tar_ustar test_tar_pax
TESTS += test_tar_gnu test_tar_sparse_gnu test_tar_sparse_gnu1
diff --git a/tests/gen_inode_table.c b/tests/gen_inode_numbers.c
index d70f463..e16abbe 100644
--- a/tests/gen_inode_table.c
+++ b/tests/gen_inode_numbers.c
@@ -50,15 +50,13 @@ static void check_children_continuous(tree_node_t *root)
int main(void)
{
tree_node_t *a, *b, *c;
- unsigned int i;
fstree_t fs;
// inode table for the empty tree
assert(fstree_init(&fs, NULL) == 0);
- assert(fstree_gen_inode_table(&fs) == 0);
- assert(fs.inode_tbl_size == 1);
+ fstree_gen_inode_numbers(&fs);
+ assert(fs.unique_inode_count == 1);
assert(fs.root->inode_num == 1);
- assert(fs.inode_table[0] == fs.root);
fstree_cleanup(&fs);
// tree with 2 levels under root, fan out 3
@@ -83,13 +81,8 @@ int main(void)
assert(gen_node(c, "c_b") != NULL);
assert(gen_node(c, "c_c") != NULL);
- assert(fstree_gen_inode_table(&fs) == 0);
- assert(fs.inode_tbl_size == 13);
-
- for (i = 0; i < 13; ++i) {
- assert(fs.inode_table[i] != NULL);
- assert(fs.inode_table[i]->inode_num == i + 1);
- }
+ fstree_gen_inode_numbers(&fs);
+ assert(fs.unique_inode_count == 13);
check_children_before_root(fs.root);
check_children_continuous(fs.root);