Add missing GPA deinit assertions to binary payload tests - #56
Merged
Conversation
…load tests Nine test blocks in binary_payload_tests.zig used createTestAllocator() but omitted the required `defer std.debug.assert(gpa.deinit() == .ok)` assertion, disabling memory leak detection for those tests. Add the missing defer immediately after `const allocator = gpa.allocator()` in each of the nine affected tests to restore full leak detection coverage.
Copilot
AI
changed the title
[WIP] Fix code based on review comments
fix(tests): add missing GPA deinit assertions to binary payload tests
Jun 21, 2026
christianhelle
marked this pull request as ready for review
June 22, 2026 10:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nine test blocks in
src/tests/binary_payload_tests.zigcalledtest_utils.createTestAllocator()but omitted the requireddefer std.debug.assert(gpa.deinit() == .ok), silently disabling memory leak detection for those tests.Changes
src/tests/binary_payload_tests.zig: Added the missingdefer std.debug.assert(gpa.deinit() == .ok)immediately afterconst allocator = gpa.allocator()in all nine affected tests, making them consistent with the full pattern used everywhere else in the test suite:Already addressed (verified in current code)
The other review comments were resolved by the prior commit and are confirmed present:
classifyBodystrips media-type parameters viamedia_type.baseMediaType()before comparisonconvertRequestBody(v3.0/3.1/3.2 converters) usesmime.selectBestJsonKey()for normalized, deterministic JSON-first selectionselectConsumesMedia(Swagger v2) usesmime.isJson()/mime.isJsonSuffix()rather than verbatim string comparisongenerateFunctionBodyDirectforcesapplication/jsoncontent-type when falling back from form encodingrequestRawWithContentType(notrequestRaw) for non-application/jsonJSON media types (e.g.application/vnd.api+json)"type"is present in theisReservedIdentlist in bothmodel_generator.zigandapi_generator.zig