summaryrefslogtreecommitdiff
path: root/tests/fstree_from_file.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-25 21:06:59 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-29 18:19:53 +0200
commit4b4cee0c0c99f531a45157fd27f5441e511db109 (patch)
tree825aae023f27c2f578536af35dfd01b1dc96e18e /tests/fstree_from_file.c
parentd87bffd89b9c0a26a65f0c629250fa87902b6cb8 (diff)
Replace file/getline usage with istream
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.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/tests/fstree_from_file.c b/tests/fstree_from_file.c
index c00cabf..f8f0892 100644
--- a/tests/fstree_from_file.c
+++ b/tests/fstree_from_file.c
@@ -9,21 +9,13 @@
#include "fstree.h"
#include "test.h"
-#define STR(x) #x
-#define STRVALUE(x) STR(x)
-
-#define TEST_PATH STRVALUE(TESTPATH)
-
int main(void)
{
tree_node_t *n;
fstree_t fs;
- FILE *fp;
-
- fp = test_open_read(TEST_PATH);
TEST_ASSERT(fstree_init(&fs, NULL) == 0);
- TEST_ASSERT(fstree_from_file(&fs, "testfile", fp) == 0);
+ TEST_ASSERT(fstree_from_file(&fs, TEST_PATH) == 0);
fstree_post_process(&fs);
n = fs.root->data.dir.children;
@@ -92,7 +84,6 @@ int main(void)
TEST_STR_EQUAL(n->name, "sock");
TEST_NULL(n->next);
- fclose(fp);
fstree_cleanup(&fs);
return EXIT_SUCCESS;
}