Skip to content

Commit

Permalink
Test ready with sparring_partner
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverPlate3 committed Aug 19, 2023
1 parent 502dc48 commit b825c88
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/posix_specific.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,23 @@ BOOST_AUTO_TEST_CASE(leak_test, *boost::unit_test::timeout(5))

BOOST_CHECK_EQUAL(fd_list.size(), fd_list_new.size());

}

BOOST_AUTO_TEST_CASE(wait_doesnt_ignore_zombie, *boost::unit_test::timeout(5))
{
using boost::unit_test::framework::master_test_suite;

bp::child childProcess(
master_test_suite().argv[1],
bp::args+={"test", "--wait", "5"}
);
int pid = childProcess.id();
BOOST_CHECK(childProcess.running());

childProcess.terminate();
childProcess.wait();

BOOST_CHECK(!childProcess.running());
BOOST_CHECK_EQUAL(kill(pid, 0), -1);
BOOST_CHECK_EQUAL(errno, ESRCH); // Target Process doesn't exist.
}

0 comments on commit b825c88

Please sign in to comment.