Skip to content

Conversation

@giuseppe
Copy link
Member

@flouthoc PTAL

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

@giuseppe tests fail on s390x

@giuseppe giuseppe force-pushed the add-new-tests branch 5 times, most recently from c55fee6 to 21f8c34 Compare December 15, 2025 12:03
@giuseppe
Copy link
Member Author

@flouthoc finally they pass

giuseppe and others added 5 commits December 15, 2025 13:44
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>
Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

LGTM

@flouthoc flouthoc merged commit abbae63 into containers:main Dec 15, 2025
6 checks passed
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.

2 participants