build: enable -Wextra by default
Change-Id: I1e6783fca6530741bf4b81dd13613a6b4235290a
Refs: #3293
diff --git a/tests/daemon/face/ethernet.t.cpp b/tests/daemon/face/ethernet.t.cpp
index a6faf06..4d6f053 100644
--- a/tests/daemon/face/ethernet.t.cpp
+++ b/tests/daemon/face/ethernet.t.cpp
@@ -201,22 +201,24 @@
face->onReceiveData.connect([&recDatas] (const Data& d) { recDatas.push_back(d); });
// check that packet data is not accessed if pcap didn't capture anything (caplen == 0)
- static const pcap_pkthdr header1{};
- face->processIncomingPacket(&header1, nullptr);
+ static const pcap_pkthdr zeroHeader{};
+ face->processIncomingPacket(&zeroHeader, nullptr);
BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 0);
BOOST_CHECK_EQUAL(recInterests.size(), 0);
BOOST_CHECK_EQUAL(recDatas.size(), 0);
// runt frame (too short)
- static const pcap_pkthdr header2{{}, ethernet::HDR_LEN + 6};
+ pcap_pkthdr runtHeader{};
+ runtHeader.caplen = ethernet::HDR_LEN + 6;
static const uint8_t packet2[ethernet::HDR_LEN + 6]{};
- face->processIncomingPacket(&header2, packet2);
+ face->processIncomingPacket(&runtHeader, packet2);
BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 0);
BOOST_CHECK_EQUAL(recInterests.size(), 0);
BOOST_CHECK_EQUAL(recDatas.size(), 0);
// valid frame, but TLV block has invalid length
- static const pcap_pkthdr header3{{}, ethernet::HDR_LEN + ethernet::MIN_DATA_LEN};
+ pcap_pkthdr validHeader{};
+ validHeader.caplen = ethernet::HDR_LEN + ethernet::MIN_DATA_LEN;
static const uint8_t packet3[ethernet::HDR_LEN + ethernet::MIN_DATA_LEN]{
0x01, 0x00, 0x5e, 0x00, 0x17, 0xaa, // destination address
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, // source address
@@ -224,13 +226,12 @@
tlv::NdnlpData, // TLV type
0xfd, 0xff, 0xff // TLV length (invalid because greater than buffer size)
};
- face->processIncomingPacket(&header3, packet3);
+ face->processIncomingPacket(&validHeader, packet3);
BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 0);
BOOST_CHECK_EQUAL(recInterests.size(), 0);
BOOST_CHECK_EQUAL(recDatas.size(), 0);
// valid frame, but TLV block has invalid type
- static const pcap_pkthdr header4{{}, ethernet::HDR_LEN + ethernet::MIN_DATA_LEN};
static const uint8_t packet4[ethernet::HDR_LEN + ethernet::MIN_DATA_LEN]{
0x01, 0x00, 0x5e, 0x00, 0x17, 0xaa, // destination address
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, // source address
@@ -238,13 +239,12 @@
0x00, // TLV type (invalid)
0x00 // TLV length
};
- face->processIncomingPacket(&header4, packet4);
+ face->processIncomingPacket(&validHeader, packet4);
BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 2);
BOOST_CHECK_EQUAL(recInterests.size(), 0);
BOOST_CHECK_EQUAL(recDatas.size(), 0);
// valid frame and valid NDNLP header, but invalid payload
- static const pcap_pkthdr header5{{}, ethernet::HDR_LEN + ethernet::MIN_DATA_LEN};
static const uint8_t packet5[ethernet::HDR_LEN + ethernet::MIN_DATA_LEN]{
0x01, 0x00, 0x5e, 0x00, 0x17, 0xaa, // destination address
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, // source address
@@ -256,13 +256,12 @@
0x00, // NDN TLV type (invalid)
0x00 // NDN TLV length
};
- face->processIncomingPacket(&header5, packet5);
+ face->processIncomingPacket(&validHeader, packet5);
BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 18);
BOOST_CHECK_EQUAL(recInterests.size(), 0);
BOOST_CHECK_EQUAL(recDatas.size(), 0);
// valid frame, valid NDNLP header, and valid NDN (interest) packet
- static const pcap_pkthdr header6{{}, ethernet::HDR_LEN + ethernet::MIN_DATA_LEN};
static const uint8_t packet6[ethernet::HDR_LEN + ethernet::MIN_DATA_LEN]{
0x01, 0x00, 0x5e, 0x00, 0x17, 0xaa, // destination address
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, // source address
@@ -276,7 +275,7 @@
0x03, 0x66, 0x6f, 0x6f, 0x0a, 0x04,
0x03, 0xef, 0xe9, 0x7c
};
- face->processIncomingPacket(&header6, packet6);
+ face->processIncomingPacket(&validHeader, packet6);
BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 56);
BOOST_CHECK_EQUAL(recInterests.size(), 1);
BOOST_CHECK_EQUAL(recDatas.size(), 0);