blob: 2defe742f92f4f81583eadbc1e2c5f6519264db3 [file] [log] [blame]
#include "aos/common/queue_testutils.h"
#include <thread>
#include "gtest/gtest.h"
#include "aos/common/logging/logging.h"
namespace aos {
namespace common {
namespace testing {
// Tests logging from multiple threads.
// tsan used to complain about this.
TEST(QueueTestutilsTest, MultithreadedLog) {
EnableTestLogging();
::std::thread thread([]() {
for (int i = 0; i < 1000; ++i) {
LOG(INFO, "test from thread\n");
}
});
for (int i = 0; i < 1000; ++i) {
LOG(INFO, "not from thread\n");
}
thread.join();
}
} // namespace testing
} // namespace common
} // namespace aos