You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 17, 2026. It is now read-only.
_assert_false Function implementation logic error, causing the assertion judgment result to be reversed
Problem description
The conditional judgment logic of a function is completely opposite to the function name and expected behavior:
When the input parameter result is 0 (false), the function triggers an error
When the input parameter result is non-zero (true), the function asserts through an assertion
This leads to the use of assert_false(condition) in test cases, where the actual expected condition is true (non-zero), which contradicts the original intention of the function design.
title
_assert_false Function implementation logic error, causing the assertion judgment result to be reversed
Problem description
The conditional judgment logic of a function is completely opposite to the function name and expected behavior:
When the input parameter result is 0 (false), the function triggers an error
When the input parameter result is non-zero (true), the function asserts through an assertion
This leads to the use of assert_false(condition) in test cases, where the actual expected condition is true (non-zero), which contradicts the original intention of the function design.
Reproduce steps
but output it
Debugging shows that the value of 'result' is indeed 0, but the '_assert_false ' function incorrectly triggered an assertion failure
Reason for the problem
in src/cmockery. c