[v2] Add new fingerprint and object view tests#414
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## anilm3/v2 #414 +/- ##
==========================================
Coverage 85.39% 85.40%
==========================================
Files 176 176
Lines 9015 9014 -1
Branches 3842 3842
==========================================
Hits 7698 7698
Misses 512 512
+ Partials 805 804 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds new tests for nested key-path access in object_view and expands fingerprint processor integration tests for various invalid input scenarios, along with minor include cleanup and internal API refinements.
- Added
KeyPathAccessunit test for nested map access inobject_view - Introduced multiple
Invalid*integration tests for the fingerprint processor - Removed unused headers and replaced direct
.type()calls with public API inobject_storeandobject.hpp
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/object_view_test.cpp | Added KeyPathAccess test for nested find_key_path behavior |
| tests/integration/processors/fingerprint/test.cpp | Added several Invalid* tests covering fingerprinting edge cases |
| src/object_store.hpp | Removed unused includes |
| src/object_store.cpp | Replaced input.type() != object_type::map with !input.is_map() and optimized loop bound |
| src/object.hpp | Replaced .ref() casts with object_ref() for clarity |
Benchmarks clangBenchmark execution time: 2025-06-09 10:12:18 Comparing candidate commit 1c21512 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics. scenario:global-benchmark.random.clang
|
Benchmarks gccBenchmark execution time: 2025-06-09 10:14:02 Comparing candidate commit 1c21512 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
Benchmarks clang-pgoBenchmark execution time: 2025-06-09 09:45:35 Comparing candidate commit 0f2b04f in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
* Object view: read only abstraction to ddwaf_object (#341) * [v2] Remove mingw builds (#381) * Writable objects: owned and borrowed object and object limits removal (#378, #382) * [v2] Refactor and improve object types (#387) * [v2] Update unit tests to use new abstractions (#389) * [v2] Update `raw_configuration` type to use `object_view` (#390) * [v2] Remove remaining uses of ddwaf_object in `src` and `tests/unit` (#391) * [v2] JWT Decoding Processor (#401) * [v2] First iteration of object layout changes (#394) * Split context data insertion from evaluation (#407) * [v2] Second iteration of object layout changes (#408) * [v2] Add new fingerprint and object view tests (#414) * Reenable attribute collector unit test (#415) * [v2] Container view types (#413) * Exclude assertions from coverage (#416) * [v2] Use allocators internally instead of malloc/free and stop generating zero-terminated strings (#418) * Add memory resource to owned and borrowed objects (#428) * [v2] Propagate allocators from context (#420) * [v2] Update interface and expose allocators (#427) * Refactor evaluation stages out of the context (#442) * Subcontext: replace ephemerals with a new scope with user-defined lifetime derived from the context (#443) * Validator: Add support for testing subcontexts and attributes (#451) * [v2] Pass allocator to context and subcontext eval and add new allocators (#452) * Update logger to avoid dependencies on ddwaf.h (#453) * [v2] Return DDWAF_MATCH when there are events, attributes or actions (#455) * [v2] Cleanup: remove exclusion namespace and some redundant references (#456)
This PR simply adds a few new tests for both the fingerprinting processor and object view, some other small inconsequential changes have been made as well.