Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply clang-format to Tests #1456

Merged
merged 39 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8e510c5
first
tigercosmos Jun 26, 2024
52a3cb0
logger
tigercosmos Jun 26, 2024
a32c83d
other
tigercosmos Jun 26, 2024
e512cc5
revert header ordering
tigercosmos Jun 26, 2024
2c12900
Merge remote-tracking branch 'origin/dev' into clang-format0621
tigercosmos Jun 24, 2024
f341b0d
some fix
tigercosmos Jul 7, 2024
815531e
update
tigercosmos Jul 7, 2024
bc354cd
Revert "update"
tigercosmos Jul 7, 2024
724bf63
fix wrong format
tigercosmos Jul 17, 2024
68e18e0
disable width length
tigercosmos Jul 18, 2024
c72c47e
format again
tigercosmos Jul 18, 2024
bdb8fca
fix tab
tigercosmos Jul 18, 2024
e7a8a3d
Merge branch 'dev' into clang-format0621
tigercosmos Jul 18, 2024
7923804
Merge branch 'clang-format0621' of github.com:tigercosmos/PcapPlusPlu…
tigercosmos Jul 18, 2024
320eb40
BreakStringLiterals: false
tigercosmos Jul 19, 2024
8fc8bf9
update
tigercosmos Jul 19, 2024
29ec629
Merge remote-tracking branch 'upstream/dev' into clang-format0621
tigercosmos Jul 22, 2024
f2974d6
fix
tigercosmos Jul 22, 2024
9db4e95
clang-format off
tigercosmos Jul 22, 2024
07037ba
string issue
tigercosmos Jul 22, 2024
ab94ff0
long line issue
tigercosmos Jul 22, 2024
a43fbbf
tab issue
tigercosmos Jul 22, 2024
c4df19f
fix
tigercosmos Jul 22, 2024
e5a16eb
includes
tigercosmos Jul 22, 2024
651b95a
long string
tigercosmos Jul 22, 2024
9bf2d10
fix format for ipmac
tigercosmos Jul 22, 2024
e666d89
fix break
tigercosmos Jul 22, 2024
1ddd8f6
fix test
tigercosmos Jul 22, 2024
344ff70
fix the include order
tigercosmos Jul 22, 2024
ff05fb0
include
tigercosmos Jul 23, 2024
5129199
fix
tigercosmos Jul 23, 2024
bbf5092
fix
tigercosmos Jul 23, 2024
1b39d7f
fix
tigercosmos Jul 23, 2024
1caa137
fix
tigercosmos Jul 24, 2024
75a0b14
revert
tigercosmos Jul 24, 2024
74d6aa6
comment
tigercosmos Jul 24, 2024
379f334
comment
tigercosmos Jul 24, 2024
718d14c
ignore
tigercosmos Jul 24, 2024
9ba00c7
Merge branch 'dev' into clang-format0621
seladb Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tests/Fuzzers/DumpToFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

// This function is created as PcapPlusPlus doesn't seem to offer a way of
// parsing Pcap files directly from memory
static int dumpDataToPcapFile(const uint8_t *data, size_t size, const char* path)
static int dumpDataToPcapFile(const uint8_t* data, size_t size, const char* path)
{
FILE *fd;
FILE* fd;
int written = 0;

fd = fopen(path, "wb");
Expand Down
13 changes: 6 additions & 7 deletions Tests/Fuzzers/FuzzTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
static std::string tmpName;
static std::string tmpFile;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
if (tmpName.empty())
tmpName = tmpnam (NULL);
tmpName = tmpnam(NULL);

if (tmpFile.empty())
tmpFile = tmpName + FILE_EXT;
Expand All @@ -32,15 +32,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)

pcpp::IPcapDevice::PcapStats stats;
reader->getStatistics(stats);
std::cout << "Read " << stats.packetsRecv << " packets successfully and "
<< stats.packetsDrop << " packets could not be read" << std::endl;
std::cout << "Read " << stats.packetsRecv << " packets successfully and " << stats.packetsDrop
<< " packets could not be read" << std::endl;

if (auto ngReader = dynamic_cast<pcpp::PcapNgFileReaderDevice*>(reader.get()))
{
std::cout << "OS is '" << ngReader->getOS() << "'; Hardware is '" << ngReader->getHardware() << "'"
<< "'; CaptureApplication is '" << ngReader->getCaptureApplication()
<< "'; CaptureFileComment is '" << ngReader->getCaptureFileComment()
<< "'" << std::endl;
<< "'; CaptureApplication is '" << ngReader->getCaptureApplication() << "'; CaptureFileComment is '"
<< ngReader->getCaptureFileComment() << "'" << std::endl;
}

pcpp::RawPacketVector packets;
Expand Down
12 changes: 6 additions & 6 deletions Tests/Fuzzers/FuzzWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ static std::string tmpFile;
static std::string outPcapFile;
static int writes = 0;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
if (tmpName.empty())
tmpName = tmpnam (NULL);
tmpName = tmpnam(NULL);

if (tmpFile.empty())
tmpFile = tmpName + FILE_EXT;
Expand Down Expand Up @@ -41,9 +41,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
#endif

#ifdef NG_WRITER
pcpp::PcapNgFileWriterDevice pcapWriter(outPcapFile);
pcpp::PcapNgFileWriterDevice pcapWriter(outPcapFile);
#else
pcpp::PcapFileWriterDevice pcapWriter(outPcapFile, pcpp::LINKTYPE_ETHERNET);
pcpp::PcapFileWriterDevice pcapWriter(outPcapFile, pcpp::LINKTYPE_ETHERNET);
#endif
if (writes++ == 10)
{
Expand Down Expand Up @@ -71,8 +71,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)

pcpp::IPcapDevice::PcapStats stats;
pcapWriter.getStatistics(stats);
std::cout << "Written " << stats.packetsRecv << " packets successfully to pcap writer and "
<< stats.packetsDrop << " packets could not be written" << std::endl;
std::cout << "Written " << stats.packetsRecv << " packets successfully to pcap writer and " << stats.packetsDrop
<< " packets could not be written" << std::endl;

pcapWriter.close();
return 0;
Expand Down
Loading
Loading