File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ add_library(
1010 $<$<BOOL :${PCAPPP_USE_PCAP} >:src /PcapUtils .cpp >
1111 $<$<BOOL :${PCAPPP_USE_PCAP} >:src /NetworkUtils .cpp >
1212 src/PcapFileDevice.cpp
13- $<$<BOOL :${PCAPPP_USE_PCAP} >:src /PcapDevice .cpp >
1413 src/PcapFilter.cpp
1514 $<$<BOOL :${PCAPPP_USE_PCAP} >:src /PcapLiveDevice .cpp >
1615 $<$<BOOL :${PCAPPP_USE_PCAP} >:src /PcapLiveDeviceList .cpp >
Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ namespace pcpp
2828
2929 // / @brief Get statistics from the device
3030 // / @return An object containing the stats
31- PcapStats getStatistics () const ;
31+ PcapStats getStatistics () const
32+ {
33+ PcapStats stats;
34+ getStatistics (stats);
35+ return stats;
36+ }
3237
3338 // / Get statistics from the device
3439 // / @param[out] stats An object containing the stats
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -212,6 +212,11 @@ PTF_TEST_CASE(TestPcapFileReadWrite)
212212 PTF_ASSERT_TRUE (writerDev.writePacket (rawPacket));
213213 }
214214
215+ // TODO: Fix defect where getStatistics() is shadowed in derived classes.
216+ auto rs = static_cast <pcpp::IPcapStatisticsProvider&>(readerDev).getStatistics ();
217+ PTF_ASSERT_EQUAL ((uint32_t )rs.packetsRecv , 4631 );
218+ PTF_ASSERT_EQUAL ((uint32_t )rs.packetsDrop , 0 );
219+
215220 pcpp::PcapStats readerStatistics;
216221 pcpp::PcapStats writerStatistics;
217222
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ BUILD_DIR=${2:-build}
1818if [ " $MODE " = " changed" ]; then
1919 # Get the list of changed files from origin/dev
2020 git fetch origin dev
21- files=$( git diff --name-only origin/dev -- ' *.cpp' ' *.h' | grep -v ' 3rdParty/' || true)
21+ # --diff-filter excludes deleted files (D) as they no longer exist.
22+ files=$( git diff --name-only --diff-filter=d origin/dev -- ' *.cpp' ' *.h' | grep -v ' 3rdParty/' || true)
2223else
2324 # Find all relevant files
2425 files=$( find " ${ROOTPATH} " -type f \( -name ' *.cpp' -o -name ' *.h' \) -not -path " */3rdParty/*" )
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ BUILD_DIR=${2:-build}
1818if [ " $MODE " = " changed" ]; then
1919 # Get the list of changed files from origin/dev
2020 git fetch origin dev
21- files=$( git diff --name-only origin/dev -- ' *.cpp' ' *.h' | grep -v ' 3rdParty/' || true)
21+ # --diff-filter excludes deleted files (D) as they no longer exist.
22+ files=$( git diff --name-only --diff-filter=d origin/dev -- ' *.cpp' ' *.h' | grep -v ' 3rdParty/' || true)
2223else
2324 # Find all relevant files
2425 files=$( find " ${ROOTPATH} " -type f \( -name ' *.cpp' -o -name ' *.h' \) -not -path " */3rdParty/*" )
You can’t perform that action at this time.
0 commit comments