proxygen
SyncLevelTest.cpp File Reference

Go to the source code of this file.

Classes

class  folly::TestLogWriter
 
class  folly::TestHandlerFactory
 
class  folly::TestHandlerFactory::TestWriterFactory
 

Namespaces

 folly
 —— Concurrent Priority Queue Implementation ——
 

Functions

 TEST_F (SyncLevelTest, NoLogTest)
 
 TEST_F (SyncLevelTest, SimpleAsyncTest)
 

Function Documentation

TEST_F ( SyncLevelTest  ,
NoLogTest   
)

Definition at line 108 of file SyncLevelTest.cpp.

References folly::DBG0, folly::DBG1, folly::DBG9, EXPECT_EQ, and FB_LOG.

108  {
109  FB_LOG(logger, DBG9) << "DBG9";
110  FB_LOG(logger, DBG1) << "DBG1";
111  FB_LOG(logger, DBG0) << "DBG0";
112 
113  EXPECT_EQ(writer->unflushed_messages_count, 0);
114  EXPECT_EQ(writer->flushed_messages_count, 0);
115 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define FB_LOG(logger, level,...)
Definition: Logger.h:34
TEST_F ( SyncLevelTest  ,
SimpleAsyncTest   
)

Definition at line 117 of file SyncLevelTest.cpp.

References folly::CRITICAL, folly::DBG0, EXPECT_EQ, FB_LOG, folly::INFO, folly::INFO9, and folly::WARN.

117  {
118  FB_LOG(logger, INFO) << "INFO";
119  FB_LOG(logger, INFO) << "INFO";
120  FB_LOG(logger, INFO) << "INFO";
121  FB_LOG(logger, INFO) << "INFO";
122 
123  EXPECT_EQ(writer->unflushed_messages_count, 4);
124  EXPECT_EQ(writer->flushed_messages_count, 0);
125 
126  FB_LOG(logger, WARN) << "WARN";
127 
128  EXPECT_EQ(writer->unflushed_messages_count, 0);
129  EXPECT_EQ(writer->flushed_messages_count, 5);
130 
131  FB_LOG(logger, DBG0) << "DBG0";
132  FB_LOG(logger, INFO9) << "INFO9";
133 
134  EXPECT_EQ(writer->unflushed_messages_count, 1);
135  EXPECT_EQ(writer->flushed_messages_count, 5);
136 
137  FB_LOG(logger, INFO) << "INFO";
138  FB_LOG(logger, WARN) << "WARN";
139 
140  EXPECT_EQ(writer->unflushed_messages_count, 0);
141  EXPECT_EQ(writer->flushed_messages_count, 8);
142 
143  FB_LOG(logger, INFO) << "INFO";
144  FB_LOG(logger, CRITICAL) << "CRITICAL";
145 
146  EXPECT_EQ(writer->unflushed_messages_count, 0);
147  EXPECT_EQ(writer->flushed_messages_count, 10);
148 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define FB_LOG(logger, level,...)
Definition: Logger.h:34