Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Less comparator and IsNegativeThan implementations #455

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 13, 2024

Fix Less_comparator_test failures by correcting IsNegativeThan() and Less() implementations.

Changes

  • Fix IsNegativeThan() to properly implement x < 0 && x == -y
  • Simplify Less() implementation to directly check if difference is negative

Testing

  • Verified Less_comparator_test passes:
    Test #29: Less_comparator_test .............   Passed    0.15 sec
    
  • Verified IsNegativeThan_comparator_test passes:
    Test #30: IsNegativeThan_comparator_test ...   Passed    0.12 sec
    

Note: The Windows build failure is unrelated to these changes (Boost GIL warnings in image_codec_test).

Link to Devin run: https://preview.devin.ai/devin/0ec7d397e84b48a9b87c859843b903b2

- Fix Less operator implementation to handle equality case
- Add IsNegativeThan implementation
- Update CMakeLists.txt for new tests
- Change return type from bool to Valuable
- Update implementation to return Integer(0) for true and Integer(1) for false
- Add override keyword to declaration
- Replace test() macro with proper CMake test configuration
- Add explicit dependencies and linking
- Configure test targets correctly
- Change logic to logic1 in test target dependencies
- Fix library linking for test executables
- Add missing Variable.h include to fix incomplete type errors
- Required for proper STL container usage with Variable class
- Replace BOOST_CHECK with BOOST_CHECK_EQUAL
- Compare with Integer(0) and Integer(1) instead of boolean values
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.

0 participants