Changeset View
Changeset View
Standalone View
Standalone View
src/test/util_tests.cpp
Show First 20 Lines • Show All 1,276 Lines • ▼ Show 20 Lines | while (true) { | ||||
rv = write(fd, &ch, 1); | rv = write(fd, &ch, 1); | ||||
assert(rv == 1); | assert(rv == 1); | ||||
break; | break; | ||||
case ExitCommand: | case ExitCommand: | ||||
close(fd); | close(fd); | ||||
// As an alternative to exit() which runs the exit handlers | // As an alternative to exit() which runs the exit handlers | ||||
// (which seem to be flakey with Boost test suite with JUNIT | // (which seem to be flakey with Boost test suite with JUNIT | ||||
// logging in a forked process), just vanish this process as | // logging in a forked process), just vanish this process as | ||||
// fast as possible. | // fast as possible. `quick_exit()` would also work, but it is | ||||
std::quick_exit(0); | // not available on all non glibc platforms. | ||||
// Using exec also stops valgrind from thinking it needs to | |||||
// analyze the memory leaks in this forked process. | |||||
execlp("true", "true", (char *)NULL); | |||||
default: | default: | ||||
assert(0); | assert(0); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
BOOST_AUTO_TEST_CASE(test_LockDirectory) { | BOOST_AUTO_TEST_CASE(test_LockDirectory) { | ||||
▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines |