Skip to content

Add unit tests for RawPacket buffer APIs - #2375

Open
way-wei96 wants to merge 1 commit into
seladb:devfrom
way-wei96:rawpacket-unit-tests
Open

way-wei96 wants to merge 1 commit into
seladb:devfrom
way-wei96:rawpacket-unit-tests

Conversation

@way-wei96

@way-wei96 way-wei96 commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

Test plan

  • Packet++Test -t rawpacket
  • Formatted with clang-format 19.1.6

Cover empty reallocate, explicit non-owning setRawData, and the
documented reallocate-then-append path.
@way-wei96
way-wei96 requested a review from seladb as a code owner November 20, 2026 07:55
@Dimi1010
Dimi1010 self-requested a review November 20, 2026 10:18
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.11%. Comparing base (8561a16) to head (8dd4be0).
⚠️ Report is 3 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2375      +/-   ##
==========================================
+ Coverage   82.85%   83.11%   +0.25%     
==========================================
  Files         350      351       +1     
  Lines       68900    68723     -177     
  Branches    14255    14622     +367     
==========================================
+ Hits        57089    57119      +30     
+ Misses      10873    10658     -215     
- Partials      938      946       +8     
Flag Coverage Δ
23.11.6 6.57% <0.00%> (-0.04%) ⬇️
24.11.5 6.62% <0.00%> (-0.01%) ⬇️
25.11.1 6.62% <0.00%> (+<0.01%) ⬆️
alpine320 77.23% <100.00%> (+0.01%) ⬆️
fedora42 76.76% <100.00%> (+0.01%) ⬆️
macos-15 83.09% <100.00%> (+0.01%) ⬆️
macos-26 83.10% <100.00%> (+0.01%) ⬆️
macos-26-intel 83.03% <100.00%> (+0.01%) ⬆️
mingw32 71.73% <ø> (+<0.01%) ⬆️
mingw64 69.62% <ø> (+0.05%) ⬆️
npcap ?
rhel94 76.62% <100.00%> (+<0.01%) ⬆️
ubuntu2204 76.66% <100.00%> (+0.01%) ⬆️
ubuntu2404 76.87% <100.00%> (-0.01%) ⬇️
ubuntu2604 76.83% <100.00%> (+0.01%) ⬆️
ubuntu2604-arm64 76.75% <100.00%> (+0.01%) ⬆️
ubuntu2604-icpx 58.12% <ø> (+<0.01%) ⬆️
unittest 83.11% <100.00%> (+0.25%) ⬆️
windows-2022 85.66% <ø> (+0.09%) ⬆️
windows-2025 85.12% <ø> (+0.81%) ⬆️
winpcap 85.70% <ø> (+1.20%) ⬆️
xdp 56.36% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the added RawPacket buffer-handling tests.

No open issues 🎉

What changed in this PR

Adds focused Packet++Test coverage for RawPacket buffer handling, improving confidence in existing APIs without changing production behavior or adding capacity tracking.

Changes:

  • Tests empty-buffer reallocation, explicit non-owning buffer replacement, and appending after reallocation.
  • Registers all three tests under the packet;rawpacket tags and includes them in the build.
File Description
Tests/​Packet++Test/​Tests/​RawPacketTests.cpp Adds three buffer-handling tests.
Tests/​Packet++Test/​TestDefinition.h Declares the new test cases.
Tests/​Packet++Test/​main.cpp Registers the tests with filtering tags.
Tests/​Packet++Test/​CMakeLists.txt Adds the test source to the build.

Review effort: Balanced

@Dimi1010

Dimi1010 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Sigh... I love missclicking...

@Dimi1010 Dimi1010 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Fuzz CI faiures seem to be unrelated, since it complains about /tmp/not-out/tmp8hawj75b/FuzzTargetNg: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by /tmp/not-out/tmp8hawj75b/FuzzTargetNg)` which is not part of the PR changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants