#include #include #include #include #include #include "errlogstream.h" namespace { struct tester { std::string buf; epicsEvent evnt; bool wait; unsigned called; tester() :wait(false), called(0) { errlogAddListener(&handler, (void*)this); } ~tester() { errlogRemoveListeners(&handler, (void*)this); } static void handler(void *raw, const char *msg) { tester *self = (tester*)raw; if(self->wait) self->evnt.wait(); self->called++; self->buf += msg; } }; void testNoBlock(const char *msg) { testDiag("Test non blocking with message length %u", (unsigned)strlen(msg)); tester T; T.wait = true; { errlog_ostream strm(false, 16); strm<