Skip to content

Commit 0a0d2ad

Browse files
authored
Suppress logs in tests (#2051)
1 parent 077a6cf commit 0a0d2ad

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

Tests/Pcap++Test/Tests/FileTests.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,17 +1593,26 @@ PTF_TEST_CASE(TestPcapNgFileReadWriteAdv)
15931593

15941594
pcpp::PcapNgFileReaderDevice readerDev5(EXAMPLE2_PCAPNG_PATH);
15951595
PTF_ASSERT_TRUE(readerDev5.open());
1596-
PTF_ASSERT_FALSE(readerDev5.setFilter("bla bla bla"));
1596+
{
1597+
SuppressLogs suppressLogs;
1598+
PTF_ASSERT_FALSE(readerDev5.setFilter("bla bla bla"));
1599+
}
15971600
PTF_ASSERT_TRUE(readerDev5.setFilter("src net 130.217.250.129"));
15981601

15991602
pcpp::PcapNgFileWriterDevice writerDev2(EXAMPLE2_PCAPNG_WRITE_PATH);
16001603
PTF_ASSERT_TRUE(writerDev2.open(true));
1601-
PTF_ASSERT_FALSE(writerDev2.setFilter("bla bla bla"));
1604+
{
1605+
SuppressLogs suppressLogs;
1606+
PTF_ASSERT_FALSE(writerDev2.setFilter("bla bla bla"));
1607+
}
16021608
PTF_ASSERT_TRUE(writerDev2.setFilter("dst port 35938"));
16031609

16041610
pcpp::PcapNgFileWriterDevice writerCompressDev2(EXAMPLE2_PCAPNG_ZSTD_WRITE_PATH, 5);
16051611
PTF_ASSERT_TRUE(writerCompressDev2.open()); // Do not try append mode on compressed files!!!
1606-
PTF_ASSERT_FALSE(writerCompressDev2.setFilter("bla bla bla"));
1612+
{
1613+
SuppressLogs suppressLogs;
1614+
PTF_ASSERT_FALSE(writerCompressDev2.setFilter("bla bla bla"));
1615+
}
16071616
PTF_ASSERT_TRUE(writerCompressDev2.setFilter("dst port 35938"));
16081617

16091618
int filteredReadPacketCount = 0;

0 commit comments

Comments
 (0)