}
class EventHandlerMock : public EventHandler {
-public:
+ public:
EventHandlerMock(EventBase* eb, int fd) : EventHandler(eb, fd) {}
// gmock can't mock noexcept methods, so we need an intermediary
MOCK_METHOD1(_handlerReady, void(uint16_t));
};
class EventHandlerTest : public Test {
-public:
+ public:
int efd = 0;
void SetUp() override {
runInThreadsAndWait(nproducers,
[&](size_t /* k */) {
for (size_t i = 0; i < writes / nproducers; ++i) {
- this_thread::sleep_for(chrono::milliseconds(1));
+ this_thread::sleep_for(
+ std::chrono::milliseconds(1));
efd_write(1);
}
});
runInThreadsAndWait(nproducers,
[&](size_t /* k */) {
for (size_t i = 0; i < writes / nproducers; ++i) {
- this_thread::sleep_for(chrono::milliseconds(1));
+ this_thread::sleep_for(
+ std::chrono::milliseconds(1));
queue.blockingWrite(nullptr);
efd_write(1);
--writesRemaining;