Changeset View
Changeset View
Standalone View
Standalone View
src/test/util_tests.cpp
Show First 20 Lines • Show All 1,273 Lines • ▼ Show 20 Lines | while (true) { | ||||
case UnlockCommand: | case UnlockCommand: | ||||
ReleaseDirectoryLocks(); | ReleaseDirectoryLocks(); | ||||
ch = true; // Always succeeds | ch = true; // Always succeeds | ||||
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); | ||||
exit(0); | // As an alternative to exit() which runs the exit handlers, | ||||
// just vanish this process as fast as possible. This also stops | |||||
// valgrind from looking into this uninteresting subprocess. | |||||
// (quick_exit() would also work, but it triggers a spurious | |||||
// glibc-valgrind error in pre-3.15 versions.) | |||||
execlp("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 |