summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-18 15:55:03 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-18 15:55:03 +0100
commit2777dfe050359c359233b2f00dfb5c3b2dba4ed6 (patch)
treee120ef9c10295c74dc8c3ec6dfa39aaa665e7f6b /tests
parentcaf350448c0020f95b9bfdd65770d86faf548549 (diff)
Cleanup: merge the fstree post processing functions
Instead of having 3 different functions for sorting the tree, numbering the nodes and generating a file list, that all have to be used in the right order, this commit merges them into a single "fstree_post_process" function. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/fstree_from_file.c2
-rw-r--r--tests/gen_inode_numbers.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/fstree_from_file.c b/tests/fstree_from_file.c
index a0b6b2d..eccd1f4 100644
--- a/tests/fstree_from_file.c
+++ b/tests/fstree_from_file.c
@@ -42,7 +42,7 @@ int main(void)
assert(fstree_init(&fs, NULL) == 0);
assert(fstree_from_file(&fs, "testfile", fp) == 0);
- tree_node_sort_recursive(fs.root);
+ fstree_post_process(&fs);
n = fs.root->data.dir.children;
assert(n->mode == (S_IFBLK | 0600));
diff --git a/tests/gen_inode_numbers.c b/tests/gen_inode_numbers.c
index e16abbe..dc8ca4c 100644
--- a/tests/gen_inode_numbers.c
+++ b/tests/gen_inode_numbers.c
@@ -54,7 +54,7 @@ int main(void)
// inode table for the empty tree
assert(fstree_init(&fs, NULL) == 0);
- fstree_gen_inode_numbers(&fs);
+ fstree_post_process(&fs);
assert(fs.unique_inode_count == 1);
assert(fs.root->inode_num == 1);
fstree_cleanup(&fs);
@@ -81,7 +81,7 @@ int main(void)
assert(gen_node(c, "c_b") != NULL);
assert(gen_node(c, "c_c") != NULL);
- fstree_gen_inode_numbers(&fs);
+ fstree_post_process(&fs);
assert(fs.unique_inode_count == 13);
check_children_before_root(fs.root);