23 using namespace folly;
26 void expectWouldBlock(ssize_t r) {
27 int savedErrno = errno;
31 void expectOK(ssize_t r) {
32 int savedErrno = errno;
67 int flags = ::fcntl(p[0], F_GETFL);
69 expectOK(::fcntl(p[0], F_SETFL, flags | O_NONBLOCK));
70 expectWouldBlock(::
read(p[0], &buf, 1));
83 expectWouldBlock(::
read(p[0], &buf, 1));
88 ssize_t r =
::read(p[0], &buf, 1);
95 File in(STDOUT_FILENO,
false);
96 CHECK_EQ(STDOUT_FILENO, in.
release());
100 #define EXPECT_CONTAINS(haystack, needle) \ 101 EXPECT_NE(::std::string::npos, ::folly::StringPiece(haystack).find(needle)) \ 102 << "Haystack: '" << haystack << "'\nNeedle: '" << needle << "'"; 106 File(
"does_not_exist.txt", 0, 0666);
107 }
catch (
const std::runtime_error& e) {
#define EXPECT_LE(val1, val2)
#define EXPECT_EQ(val1, val2)
constexpr detail::Map< Move > move
—— Concurrent Priority Queue Implementation ——
#define EXPECT_CONTAINS(haystack, needle)
static Expected< File, exception_wrapper > makeFile(Args &&...args) noexcept
size_t read(T &out, folly::io::Cursor &cursor)
fbstring errnoStr(int err)
#define EXPECT_TRUE(condition)
#define EXPECT_NE(val1, val2)
#define EXPECT_FALSE(condition)
Range< const char * > StringPiece
int close(NetworkSocket s)
TEST(SequencedExecutor, CPUThreadPoolExecutor)
void pipe(CPUExecutor cpu, IOExecutor io)