From 6fd64f93a03a611c0ae9ee151daa2aa2ca90af95 Mon Sep 17 00:00:00 2001 From: Stefano Fiorentino Date: Wed, 25 Mar 2020 19:34:05 +0100 Subject: [PATCH] Improving test coverage [adding FsReq::readdirSync] Signed-off-by: Stefano Fiorentino --- test/uvw/fs_req.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/uvw/fs_req.cpp b/test/uvw/fs_req.cpp index ab7af517..2cc127ea 100644 --- a/test/uvw/fs_req.cpp +++ b/test/uvw/fs_req.cpp @@ -802,3 +802,19 @@ TEST(FsReq, ReadDir) { ASSERT_TRUE(checkFsReadDirEvent); ASSERT_TRUE(checkFsOpenDirEvent); } + +TEST(FsReq, ReadDirSync) { + const std::string dir_name = std::string{TARGET_FS_REQ_DIR}; + + auto loop = uvw::Loop::getDefault(); + auto fsReq = loop->resource(); + + ASSERT_TRUE(fsReq->opendirSync(dir_name)); + auto res = fsReq->readdirSync(); + while(res.first) { + res = fsReq->readdirSync(); + } + ASSERT_TRUE(fsReq->closedirSync()); + + loop->run(); +}