diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-27 16:43:11 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-27 16:43:11 +0200 |
commit | 625368eb5bcb9954ad190af50962e6b7c2fd9c4c (patch) | |
tree | 48779d7e54b4fa3df83df39fff76b54d93aacedf /tests/fstree_from_file.c | |
parent | 720023d968b24fe358fd4cfb002d8572f6cc96e7 (diff) |
Cleanup: remove most of the payload pointer magic from libfstree
Now that dir_info_t and file_info_t have reasonably small, use them in
tree_node_t directly instead of doing pointer arithmetic magic on the
payload area.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/fstree_from_file.c')
-rw-r--r-- | tests/fstree_from_file.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/fstree_from_file.c b/tests/fstree_from_file.c index 1b9fd76..a8e05c3 100644 --- a/tests/fstree_from_file.c +++ b/tests/fstree_from_file.c @@ -42,7 +42,7 @@ int main(void) assert(fstree_from_file(&fs, "testfile", fp) == 0); tree_node_sort_recursive(fs.root); - n = fs.root->data.dir->children; + n = fs.root->data.dir.children; assert(n->mode == (S_IFBLK | 0600)); assert(n->uid == 8); @@ -62,21 +62,21 @@ int main(void) assert(n->uid == 4); assert(n->gid == 5); assert(strcmp(n->name, "dir") == 0); - assert(n->data.dir->children == NULL); + assert(n->data.dir.children == NULL); n = n->next; assert(n->mode == (S_IFDIR | 0755)); assert(n->uid == 0); assert(n->gid == 0); assert(strcmp(n->name, "foo bar") == 0); - assert(n->data.dir->children != NULL); - - assert(n->data.dir->children->next == NULL); - assert(n->data.dir->children->mode == (S_IFDIR | 0755)); - assert(n->data.dir->children->uid == 0); - assert(n->data.dir->children->gid == 0); - assert(strcmp(n->data.dir->children->name, " test \"") == 0); - assert(n->data.dir->children->data.dir->children == NULL); + assert(n->data.dir.children != NULL); + + assert(n->data.dir.children->next == NULL); + assert(n->data.dir.children->mode == (S_IFDIR | 0755)); + assert(n->data.dir.children->uid == 0); + assert(n->data.dir.children->gid == 0); + assert(strcmp(n->data.dir.children->name, " test \"") == 0); + assert(n->data.dir.children->data.dir.children == NULL); n = n->next; assert(n->mode == (S_IFIFO | 0644)); |