32 #include <gtest/gtest.h>
34 #include <boost/thread.hpp>
36 #include "log4cxx/appenderskeleton.h"
37 #include "log4cxx/spi/loggingevent.h"
40 #include "log4cxx/helpers/transcoder.h"
60 virtual void append(
const log4cxx::spi::LoggingEventPtr& event, log4cxx::helpers::Pool&)
63 info.
level_ =
event->getLevel();
65 LOG4CXX_ENCODE_CHAR(msgstr, event->getMessage());
68 LOG4CXX_ENCODE_CHAR(loggerstr, event->getLoggerName());
75 info_.push_back( info );
94 TEST(Rosconsole, threadedCalls)
99 logger->addAppender( appender );
101 boost::thread_group tg;
102 boost::barrier b(10);
103 for (uint32_t i = 0; i < 10; ++i)
105 tg.create_thread(boost::bind(
threadFunc, &b));
109 ASSERT_EQ(appender->
info_.size(), 10ULL);
111 logger->removeAppender(appender);
114 int main(
int argc,
char **argv)
116 testing::InitGoogleTest(&argc, argv);
119 return RUN_ALL_TESTS();