Skip to content

Conversation

@itislu
Copy link
Owner

@itislu itislu commented Jul 10, 2025

  • Compare ft_printf return value with snprintf instead of hardcoding an expected number.
  • Add comparison of return value for ft_snprintf tests
  • Add a null buffer test for ft_snprintf

@itislu itislu force-pushed the test-ft_printf-return-value branch from bc15a34 to 2e1109a Compare July 31, 2025 18:50
@itislu itislu marked this pull request as ready for review July 31, 2025 18:50
@itislu itislu requested a review from Copilot July 31, 2025 18:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the test coverage for ft_snprintf by improving return value validation and adding null buffer testing. The changes compare the return values of ft_snprintf against the standard snprintf function instead of using hardcoded expected values, and introduce a new test case for null buffer scenarios.

Key changes:

  • Replace hardcoded return value comparisons with dynamic comparison against snprintf return values
  • Add comprehensive null buffer test for ft_snprintf
  • Update all existing ft_snprintf tests to validate both buffer content and return values

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
real-tests/ft_snprintf/tests.h Add declaration for new null_buffer test function
real-tests/ft_snprintf/sourcelist.mk Include new null buffer test file in build
real-tests/ft_snprintf/07_null_buffer.c New test validating ft_snprintf behavior with null buffer
real-tests/ft_snprintf/01_string.c to 06_all_features.c Updated to compare return values with snprintf instead of hardcoded values
real-tests/ft_snprintf/00_launcher.c Register new null buffer test in test launcher
bonus/real-tests/ft_snprintf/* Mirror changes for bonus version of tests
bonus/real-tests/ft_printf/* Update printf tests to use dynamic return value comparison

@itislu itislu requested a review from dltslt July 31, 2025 18:55
@itislu
Copy link
Owner Author

itislu commented Jul 31, 2025

If you go through it commit by commit, each change should hopefully be self-explanatory.

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