MCPcopy Create free account
hub / github.com/catboost/catboost / TestMetaFlags

Method TestMetaFlags

library/cpp/logger/log_ut.cpp:187–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void TLogTest::TestMetaFlags() {
188 class TTestLogBackendStub: public TLogBackend {
189 public:
190 TTestLogBackendStub(TLogRecord::TMetaFlags& data)
191 : Data_(data)
192 {
193 }
194
195 void WriteData(const TLogRecord& record) override {
196 Data_ = record.MetaFlags;
197 }
198
199 void ReopenLog() override {
200 }
201
202 private:
203 TLogRecord::TMetaFlags& Data_;
204 };
205
206 TLogRecord::TMetaFlags metaFlags;
207 TLog log(MakeHolder<TTestLogBackendStub>(metaFlags));
208 log.Write(ELogPriority::TLOG_INFO, TString("message"), {{"key", "value"}});
209
210 TLogRecord::TMetaFlags expected{{"key", "value"}};
211 UNIT_ASSERT_EQUAL(metaFlags, expected);
212}
213
214void TLogTest::SetUp() {
215 TearDown();

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected