Skip to content

Commit 7da264b

Browse files
committed
tests, fs_event: rollback, still incomplete
1 parent 34119bf commit 7da264b

File tree

1 file changed

+5
-34
lines changed

1 file changed

+5
-34
lines changed

test/uvw/fs_event.cpp

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,11 @@
22
#include <uvw.hpp>
33

44

5-
TEST(FsEvent, Functionalities) {
6-
const std::string relative = std::string{"test.file"};
7-
const std::string absolute = std::string{TARGET_FS_EVENT_DIR} + "/" + relative;
8-
const std::string rename = std::string{TARGET_FS_EVENT_DIR} + std::string{"/test.rename"};
9-
5+
TEST(FsEvent, TODO) {
106
auto loop = uvw::Loop::getDefault();
11-
auto handle = loop->resource<uvw::FsEventHandle>();
12-
auto fileReq = loop->resource<uvw::FileReq>();
13-
auto fsReq = loop->resource<uvw::FsReq>();
14-
15-
bool checkFsEventEvent = false;
16-
17-
handle->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
18-
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
19-
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
20-
21-
handle->on<uvw::FsEventEvent>([&checkFsEventEvent, &relative](const auto &event, auto &hndl) {
22-
ASSERT_FALSE(checkFsEventEvent);
23-
ASSERT_EQ(std::string{event.filename}, relative);
24-
checkFsEventEvent = true;
25-
hndl.stop();
26-
hndl.close();
27-
ASSERT_TRUE(hndl.closing());
28-
});
29-
30-
fileReq->openSync(absolute, O_CREAT | O_RDWR | O_TRUNC, 0644);
31-
fsReq->rename(absolute, rename);
32-
handle->start(absolute);
33-
34-
ASSERT_EQ(handle->path(), absolute);
35-
ASSERT_TRUE(handle->active());
36-
ASSERT_FALSE(handle->closing());
7+
auto handle = uvw::FsEventHandle::create(loop);
378

38-
loop->run();
9+
handle = nullptr;
3910

40-
ASSERT_TRUE(checkFsEventEvent);
41-
}
11+
// TODO
12+
}

0 commit comments

Comments
 (0)