29 using namespace folly;
37 for (
int n = 0; n < 10; ++n) {
38 writer.writeMessage(folly::to<std::string>(
"message ", n,
"\n"));
67 for (
int n = 0; n < 10; ++n) {
68 writer.writeMessage(folly::to<std::string>(
"message ", n,
"\n"));
70 std::array<char, 1024> buf;
74 folly::to<std::string>(
"message ", n,
"\n"),
81 static std::vector<std::string>* internalWarnings;
83 void handleLoggingError(
87 internalWarnings->emplace_back(
std::move(msg));
92 std::array<int, 2> fds;
93 auto rc =
pipe(fds.data());
95 signal(SIGPIPE, SIG_IGN);
98 std::vector<std::string> logErrors;
99 internalWarnings = &logErrors;
106 size_t numMessages = 100;
109 for (
size_t n = 0; n < numMessages; ++n) {
110 writer.writeMessage(folly::to<std::string>(
"message ", n,
"\n"));
122 for (
const auto& msg : logErrors) {
126 EXPECT_EQ(numMessages, logErrors.size());
#define ASSERT_GT(val1, val2)
bool readFile(int fd, Container &out, size_t num_bytes=std::numeric_limits< size_t >::max())
#define EXPECT_EQ(val1, val2)
constexpr detail::Map< Move > move
ssize_t readFull(int fd, void *buf, size_t count)
—— Concurrent Priority Queue Implementation ——
PolymorphicMatcher< internal::HasSubstrMatcher< internal::string > > HasSubstr(const internal::string &substring)
constexpr auto data(C &c) -> decltype(c.data())
void checkUnixError(ssize_t ret, Args &&...args)
static void setInternalWarningHandler(InternalWarningHandler handler)
#define EXPECT_THAT(value, matcher)
Range< const char * > StringPiece
#define ASSERT_TRUE(condition)
int close(NetworkSocket s)
TEST(SequencedExecutor, CPUThreadPoolExecutor)
void pipe(CPUExecutor cpu, IOExecutor io)