add new tests#167
Merged
flouthoc merged 5 commits intocontainers:mainfrom Dec 15, 2025
Merged
Conversation
c55fee6 to
21f8c34
Compare
Member
Author
|
@flouthoc finally they pass |
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
The clone code for map types (mapStringString, etc.) was not checking if the source map was NULL before calling clone_map_string_string(). Since clone_map_string_string() returns NULL for NULL input, this was incorrectly treated as an error, causing clone operations to fail when any optional map field was not set. Wrap the clone call in a NULL check to handle optional map fields correctly. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
The generated clone functions did not check if the source pointer was NULL before accessing its members, causing a segfault when cloning NULL. Add a NULL check at the start of each clone function to return NULL immediately if src is NULL, matching the behavior of the free functions. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Add two new test files: test-12: Tests clone functionality including: - Clone round-trip verification (parse -> clone -> generate -> parse) - Clone independence (modifying clone doesn't affect original) - Present flags verification for numeric and boolean fields - Array cloning verification test-13: Tests error handling and edge cases including: - Invalid JSON parsing - Empty JSON object - Nonexistent file - NULL input handling - Empty arrays - Strings with special characters (newlines, tabs, quotes) - Large numbers - Clone and free of NULL pointers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
When make distcheck fails, print the test-suite.log file to help diagnose test failures on CI. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
21f8c34 to
c7ce09d
Compare
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.
@flouthoc PTAL