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

[test] add cases for issues #1229 #1231 #1244 and some test refactoring #1256

Conversation

barendgehrels
Copy link
Collaborator

No description provided.

@barendgehrels barendgehrels self-assigned this Mar 3, 2024

// Change compiler defines to constexpr bools
// to make conditions more readable
// and to always compile all code.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is done in difference.cpp only, until now.
If you agree, I'll apply it in the others too. And we can apply it everywhere.
Advantages:

  • if i/o ifdef
  • code is always compiled
  • easier to read

Also, we can harmonize it with the removing of the rescaling, as done in this source file.

@@ -41,10 +68,12 @@
( #caseid, caseid[0], caseid[1], clips1, -1, area1, clips2, -1, area2, \
clips3, -1, area1 + area2, settings)

template <typename P>
template <typename P, bool ClockWise>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added ccw tests for difference, it was not earlier there. Most cases work, but a few of them don't - they are now conditionally

example_star, clip,
4, 16, 0.833333, 4, 20, 2.833333);
using box = bg::model::box<P>;
using ring = bg::model::ring<P>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changes in the block below are mainly whitespace

TEST_DIFFERENCE(issue_1231, 1, 203161.751, 2, 1237551.0171, 1);
}

if BOOST_GEOMETRY_CONSTEXPR(! is_ccw || test_failures)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@awulkiew I assume this is fine, and an else branch is not needed in such cases

Copy link
Member

@vissarion vissarion left a comment

Choose a reason for hiding this comment

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

Thanks, this will help tracking the bugs in setops.

@barendgehrels barendgehrels merged commit 52fc1f6 into boostorg:develop Mar 13, 2024
23 checks passed
@barendgehrels barendgehrels deleted the test/add-cases-for-1229-1231-1244 branch March 13, 2024 09:30
@vissarion vissarion added this to the 1.85 milestone Apr 1, 2024
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