|
2 | 2 | #include <uvw.hpp> |
3 | 3 |
|
4 | 4 |
|
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) { |
10 | 6 | 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); |
37 | 8 |
|
38 | | - loop->run(); |
| 9 | + handle = nullptr; |
39 | 10 |
|
40 | | - ASSERT_TRUE(checkFsEventEvent); |
41 | | -} |
| 11 | + // TODO |
| 12 | + } |
0 commit comments