mirror of
https://github.com/boostorg/process.git
synced 2026-01-19 04:22:15 +00:00
pid no-access workarounds.
This commit is contained in:
committed by
Klemens Morgenstern
parent
b81cac8042
commit
cf14d54343
@@ -39,13 +39,18 @@ BOOST_AUTO_TEST_CASE(child_pid)
|
||||
bp2::process proc(ctx, pth, {"loop"});
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
auto c2 = bp2::child_pids(bp2::current_pid());
|
||||
BOOST_CHECK_LT(cs.size(), c2.size());
|
||||
BOOST_CHECK_LE(cs.size(), c2.size());
|
||||
BOOST_CHECK(std::find(cs.begin(), cs.end(), proc.id()) == cs.end());
|
||||
BOOST_CHECK(std::find(c2.begin(), c2.end(), proc.id()) != c2.end());
|
||||
proc.terminate();
|
||||
proc.wait();
|
||||
if (!c2.empty())
|
||||
BOOST_CHECK(std::find(c2.begin(), c2.end(), proc.id()) != c2.end());
|
||||
boost::system::error_code ec;
|
||||
proc.terminate(ec);
|
||||
if (ec)
|
||||
BOOST_CHECK(ec == boost::system::errc::permission_denied);
|
||||
else
|
||||
proc.wait();
|
||||
|
||||
auto c3 = bp2::child_pids(bp2::current_pid());
|
||||
BOOST_CHECK(std::find(c3.begin(), c3.end(), proc.id()) == c3.end());
|
||||
BOOST_CHECK_LT(c3.size(), c2.size());
|
||||
BOOST_CHECK_LE(c3.size(), c2.size());
|
||||
}
|
||||
Reference in New Issue
Block a user