aboutsummaryrefslogtreecommitdiff
path: root/lib/util/test
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/test')
-rw-r--r--lib/util/test/dir_tree_iterator.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/util/test/dir_tree_iterator.c b/lib/util/test/dir_tree_iterator.c
index 7c1aa88..a45cc30 100644
--- a/lib/util/test/dir_tree_iterator.c
+++ b/lib/util/test/dir_tree_iterator.c
@@ -29,6 +29,9 @@ int main(int argc, char **argv)
(void)argc; (void)argv;
memset(&cfg, 0, sizeof(cfg));
+ cfg.def_mtime = 1337;
+ cfg.def_uid = 42;
+ cfg.def_gid = 23;
dir = dir_tree_iterator_create(TEST_PATH, &cfg);
TEST_NOT_NULL(dir);
@@ -54,36 +57,84 @@ int main(int argc, char **argv)
TEST_STR_EQUAL(ent[0]->name, "dira");
TEST_ASSERT(S_ISDIR(ent[0]->mode));
+ TEST_EQUAL_UI(ent[0]->mtime, 1337);
+ TEST_EQUAL_UI(ent[0]->uid, 42);
+ TEST_EQUAL_UI(ent[0]->gid, 23);
TEST_STR_EQUAL(ent[1]->name, "dira/file_a0");
TEST_ASSERT(S_ISREG(ent[1]->mode));
+ TEST_EQUAL_UI(ent[1]->mtime, 1337);
+ TEST_EQUAL_UI(ent[1]->uid, 42);
+ TEST_EQUAL_UI(ent[1]->gid, 23);
TEST_STR_EQUAL(ent[2]->name, "dira/file_a1");
TEST_ASSERT(S_ISREG(ent[2]->mode));
+ TEST_EQUAL_UI(ent[2]->mtime, 1337);
+ TEST_EQUAL_UI(ent[2]->uid, 42);
+ TEST_EQUAL_UI(ent[2]->gid, 23);
TEST_STR_EQUAL(ent[3]->name, "dira/file_a2");
TEST_ASSERT(S_ISREG(ent[3]->mode));
+ TEST_EQUAL_UI(ent[3]->mtime, 1337);
+ TEST_EQUAL_UI(ent[3]->uid, 42);
+ TEST_EQUAL_UI(ent[3]->gid, 23);
TEST_STR_EQUAL(ent[4]->name, "dirb");
TEST_ASSERT(S_ISDIR(ent[4]->mode));
+ TEST_EQUAL_UI(ent[4]->mtime, 1337);
+ TEST_EQUAL_UI(ent[4]->uid, 42);
+ TEST_EQUAL_UI(ent[4]->gid, 23);
TEST_STR_EQUAL(ent[5]->name, "dirb/dirx");
TEST_ASSERT(S_ISDIR(ent[5]->mode));
+ TEST_EQUAL_UI(ent[5]->mtime, 1337);
+ TEST_EQUAL_UI(ent[5]->uid, 42);
+ TEST_EQUAL_UI(ent[5]->gid, 23);
TEST_STR_EQUAL(ent[6]->name, "dirb/dirx/file_x0");
TEST_ASSERT(S_ISREG(ent[6]->mode));
+ TEST_EQUAL_UI(ent[6]->mtime, 1337);
+ TEST_EQUAL_UI(ent[6]->uid, 42);
+ TEST_EQUAL_UI(ent[6]->gid, 23);
TEST_STR_EQUAL(ent[7]->name, "dirb/dirx/file_x1");
TEST_ASSERT(S_ISREG(ent[7]->mode));
+ TEST_EQUAL_UI(ent[7]->mtime, 1337);
+ TEST_EQUAL_UI(ent[7]->uid, 42);
+ TEST_EQUAL_UI(ent[7]->gid, 23);
TEST_STR_EQUAL(ent[8]->name, "dirb/dirx/file_x2");
TEST_ASSERT(S_ISREG(ent[8]->mode));
+ TEST_EQUAL_UI(ent[8]->mtime, 1337);
+ TEST_EQUAL_UI(ent[8]->uid, 42);
+ TEST_EQUAL_UI(ent[8]->gid, 23);
TEST_STR_EQUAL(ent[9]->name, "dirb/file_b0");
TEST_ASSERT(S_ISREG(ent[9]->mode));
+ TEST_EQUAL_UI(ent[9]->mtime, 1337);
+ TEST_EQUAL_UI(ent[9]->uid, 42);
+ TEST_EQUAL_UI(ent[9]->gid, 23);
TEST_STR_EQUAL(ent[10]->name, "dirb/file_b1");
TEST_ASSERT(S_ISREG(ent[10]->mode));
+ TEST_EQUAL_UI(ent[10]->mtime, 1337);
+ TEST_EQUAL_UI(ent[10]->uid, 42);
+ TEST_EQUAL_UI(ent[10]->gid, 23);
TEST_STR_EQUAL(ent[11]->name, "dirb/file_b2");
TEST_ASSERT(S_ISREG(ent[11]->mode));
+ TEST_EQUAL_UI(ent[11]->mtime, 1337);
+ TEST_EQUAL_UI(ent[11]->uid, 42);
+ TEST_EQUAL_UI(ent[11]->gid, 23);
TEST_STR_EQUAL(ent[12]->name, "dirc");
TEST_ASSERT(S_ISDIR(ent[12]->mode));
+ TEST_EQUAL_UI(ent[12]->mtime, 1337);
+ TEST_EQUAL_UI(ent[12]->uid, 42);
+ TEST_EQUAL_UI(ent[12]->gid, 23);
TEST_STR_EQUAL(ent[13]->name, "dirc/file_c0");
TEST_ASSERT(S_ISREG(ent[13]->mode));
+ TEST_EQUAL_UI(ent[13]->mtime, 1337);
+ TEST_EQUAL_UI(ent[13]->uid, 42);
+ TEST_EQUAL_UI(ent[13]->gid, 23);
TEST_STR_EQUAL(ent[14]->name, "dirc/file_c1");
TEST_ASSERT(S_ISREG(ent[14]->mode));
+ TEST_EQUAL_UI(ent[14]->mtime, 1337);
+ TEST_EQUAL_UI(ent[14]->uid, 42);
+ TEST_EQUAL_UI(ent[14]->gid, 23);
TEST_STR_EQUAL(ent[15]->name, "dirc/file_c2");
TEST_ASSERT(S_ISREG(ent[15]->mode));
+ TEST_EQUAL_UI(ent[15]->mtime, 1337);
+ TEST_EQUAL_UI(ent[15]->uid, 42);
+ TEST_EQUAL_UI(ent[15]->gid, 23);
for (i = 0; i < 16; ++i)
free(ent[i]);