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/mknode_simple.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/mknode_simple.c')
-rw-r--r-- | tests/mknode_simple.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/mknode_simple.c b/tests/mknode_simple.c index e872369..e77f4ff 100644 --- a/tests/mknode_simple.c +++ b/tests/mknode_simple.c @@ -26,15 +26,13 @@ int main(void) sb.st_rdev = 789; sb.st_size = 1337; - node = fstree_mknode(NULL, "sockfile", 8, (void *)0x1000, &sb); + node = fstree_mknode(NULL, "sockfile", 8, NULL, &sb); assert((char *)node->name >= (char *)node->payload); assert(strcmp(node->name, "sockfile") == 0); assert(node->uid == sb.st_uid); assert(node->gid == sb.st_gid); assert(node->mode == sb.st_mode); assert(node->parent == NULL); - assert(node->data.dir == NULL); - assert(node->data.file == NULL); assert(node->data.slink_target == NULL); assert(node->data.devno == 0); free(node); @@ -47,15 +45,13 @@ int main(void) sb.st_rdev = 789; sb.st_size = 1337; - node = fstree_mknode(NULL, "fifo", 4, (void *)0x1000, &sb); + node = fstree_mknode(NULL, "fifo", 4, NULL, &sb); assert((char *)node->name >= (char *)node->payload); assert(strcmp(node->name, "fifo") == 0); assert(node->uid == sb.st_uid); assert(node->gid == sb.st_gid); assert(node->mode == sb.st_mode); assert(node->parent == NULL); - assert(node->data.dir == NULL); - assert(node->data.file == NULL); assert(node->data.slink_target == NULL); assert(node->data.devno == 0); free(node); @@ -68,7 +64,7 @@ int main(void) sb.st_rdev = 789; sb.st_size = 1337; - node = fstree_mknode(NULL, "blkdev", 6, (void *)0x1000, &sb); + node = fstree_mknode(NULL, "blkdev", 6, NULL, &sb); assert((char *)node->name >= (char *)node->payload); assert(strcmp(node->name, "blkdev") == 0); assert(node->uid == sb.st_uid); @@ -86,7 +82,7 @@ int main(void) sb.st_rdev = 789; sb.st_size = 1337; - node = fstree_mknode(NULL, "chardev", 7, (void *)0x1000, &sb); + node = fstree_mknode(NULL, "chardev", 7, NULL, &sb); assert((char *)node->name >= (char *)node->payload); assert(strcmp(node->name, "chardev") == 0); assert(node->uid == sb.st_uid); |