ongoing review
This commit is contained in:
parent
9755981538
commit
546cf458da
@ -107,7 +107,7 @@ class UDPHandle final: public Handle<UDPHandle, uv_udp_t> {
|
||||
|
||||
if(nread > 0) {
|
||||
// data available (can be truncated)
|
||||
udp.publish(UDPDataEvent{details::address<I>(aptr), std::move(data), static_cast<std::size_t>(nread), static_cast<bool>(flags & UV_UDP_PARTIAL)});
|
||||
udp.publish(UDPDataEvent{details::address<I>(aptr), std::move(data), static_cast<std::size_t>(nread), !(0 == (flags & UV_UDP_PARTIAL))});
|
||||
} else if(nread == 0 && addr == nullptr) {
|
||||
// no more data to be read, doing nothing is fine
|
||||
} else if(nread == 0 && addr != nullptr) {
|
||||
|
||||
@ -534,7 +534,9 @@ TEST(FileReq, Chown) {
|
||||
});
|
||||
|
||||
request->on<uvw::FsEvent<uvw::FileReq::Type::FSTAT>>([](const auto &event, auto &req) {
|
||||
req.chown(event.stat.st_uid, event.stat.st_gid);
|
||||
auto uid = static_cast<uvw::Uid>(event.stat.st_uid);
|
||||
auto gid = static_cast<uvw::Uid>(event.stat.st_gid);
|
||||
req.chown(uid, gid);
|
||||
});
|
||||
|
||||
request->on<uvw::FsEvent<uvw::FileReq::Type::OPEN>>([](const auto &, auto &req) {
|
||||
@ -560,7 +562,9 @@ TEST(FileReq, ChownSync) {
|
||||
auto statR = request->statSync();
|
||||
|
||||
ASSERT_TRUE(statR.first);
|
||||
ASSERT_TRUE(request->chownSync(statR.second.st_uid, statR.second.st_gid));
|
||||
auto uid = static_cast<uvw::Uid>(statR.second.st_uid);
|
||||
auto gid = static_cast<uvw::Uid>(statR.second.st_gid);
|
||||
ASSERT_TRUE(request->chownSync(uid, gid));
|
||||
ASSERT_TRUE(request->closeSync());
|
||||
|
||||
loop->run();
|
||||
|
||||
@ -665,7 +665,9 @@ TEST(FsReq, Chown) {
|
||||
});
|
||||
|
||||
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::STAT>>([&filename](const auto &event, auto &request) {
|
||||
request.chown(filename, event.stat.st_uid, event.stat.st_gid);
|
||||
auto uid = static_cast<uvw::Uid>(event.stat.st_uid);
|
||||
auto gid = static_cast<uvw::Uid>(event.stat.st_gid);
|
||||
request.chown(filename, uid, gid);
|
||||
});
|
||||
|
||||
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename](const auto &, auto &) {
|
||||
@ -697,7 +699,9 @@ TEST(FsReq, ChownSync) {
|
||||
auto statR = fsReq->statSync(filename);
|
||||
|
||||
ASSERT_TRUE(statR.first);
|
||||
ASSERT_TRUE(fsReq->chownSync(filename, statR.second.st_uid, statR.second.st_gid));
|
||||
auto uid = static_cast<uvw::Uid>(statR.second.st_uid);
|
||||
auto gid = static_cast<uvw::Uid>(statR.second.st_gid);
|
||||
ASSERT_TRUE(fsReq->chownSync(filename, uid, gid));
|
||||
|
||||
loop->run();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user