|
|
@@ -32,32 +32,32 @@ TEST_F(CLoggerTest, FlushesOnFlushCall) {
|
|
|
|
|
|
TEST_F(CLoggerTest, LogsWithFmtCode) {
|
|
|
using testing::_;
|
|
|
- using testing::HasSubstr;
|
|
|
+ using testing::Field;
|
|
|
// TODO: Eq
|
|
|
- EXPECT_CALL(*pimpl, write(_, HasSubstr("5"))).Times(1);
|
|
|
+ EXPECT_CALL(*pimpl, write(Field(&logpacket::message, "5"))).Times(1);
|
|
|
t_logger("", pimpl).errorf("%d", 5);
|
|
|
}
|
|
|
|
|
|
// TODO: This is wrong
|
|
|
TEST_F(CLoggerTest, FmtLogHasNameInHeader) {
|
|
|
using testing::_;
|
|
|
- using testing::HasSubstr;
|
|
|
- EXPECT_CALL(*pimpl, write(_, HasSubstr("TEST"))).Times(1);
|
|
|
+ using testing::Field;
|
|
|
+ EXPECT_CALL(*pimpl, write(Field(&logpacket::logger, "TEST"))).Times(1);
|
|
|
t_logger("TEST", pimpl).errorf("%d", 5);
|
|
|
}
|
|
|
|
|
|
// TODO: This is wrong
|
|
|
TEST_F(CLoggerTest, FmtLogHasLevelInHeader) {
|
|
|
using testing::_;
|
|
|
- using testing::HasSubstr;
|
|
|
- EXPECT_CALL(*pimpl, write(_, HasSubstr("[ERROR]"))).Times(1);
|
|
|
+ using testing::Field;
|
|
|
+ EXPECT_CALL(*pimpl, write(Field(&logpacket::level, LERROR))).Times(1);
|
|
|
t_logger("TEST", pimpl).errorf("%d", 5);
|
|
|
}
|
|
|
|
|
|
TEST_F(CLoggerTest, LogsRawData) {
|
|
|
using testing::_;
|
|
|
- using testing::HasSubstr;
|
|
|
- EXPECT_CALL(*pimpl, write(_, "5")).Times(1);
|
|
|
+ using testing::Field;
|
|
|
+ EXPECT_CALL(*pimpl, write(Field(&logpacket::message, "5"))).Times(1);
|
|
|
t_logger("", pimpl).error("5");
|
|
|
}
|
|
|
|