MCPcopy Create free account
hub / github.com/MEONMedical/Log4Qt / testBinaryLogStream

Method testBinaryLogStream

tests/binaryloggertest/binaryloggertest.cpp:276–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276void BinaryLoggerTest::testBinaryLogStream()
277{
278 char expected[] = {0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
279 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x40,
280 0x0d, 0x00, 0x00, 0x00, 0x48, 0x65, 0x6c, 0x6c,
281 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x21,
282 0x00
283 };
284 {
285 Log4Qt::BinaryLogStream bls{Log4Qt::Logger::logger(binLogger), Log4Qt::Level::INFO_INT};
286 bls << QByteArray(expected + 4, 4);
287 bls << QByteArray(expected + 8, 8)
288 << QByteArray(expected + 16, 4)
289 << QByteArray(expected + 20, 13);
290 }
291
292 auto blogger = Log4Qt::Logger::logger(binLogger);
293 QCOMPARE(flushLogger(blogger), QByteArray(expected, elementsInArray(expected)));
294}
295
296void BinaryLoggerTest::testBinaryLogger()
297{

Callers

nothing calls this directly

Calls 2

elementsInArrayFunction · 0.85
QByteArrayClass · 0.70

Tested by

no test coverage detected