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
The CI failures on this branch all come down to one line in SepTest, plus a second, independent issue in the same separate().
The failures
macosmatrix.yml fails at compile time, on the Python bindings: codac2_SepTest.h:30:42: error: while substituting deduced template arguments into function template 'shared_ptr...' while building python/src/core/separators/codac2_py_SepTest.cpp.
tests.yml, vcmatrix.yml and dockercentos.yml fail at run time, in the Python package suite:
ERROR: test_SepTest (codac.tests.test_SepTest.TestSepTest)
File ".../codac/tests/test_SepTest.py", line 25, in test_SepTest
inner,outer = sep_test.separate(x1)
ValueError: The following Codac assertion failed:
In function: separate x.size() == _sep.size()
In file: src/core/separators/codac2_SepTest.cpp:19
unixmatrix.yml and dockermatrix.yml are green because they do not run python -m unittest discover codac.tests, and because the C++ test never runs either (see the third point below).
1. _sep is a reference member bound to a temporary
s is a separator, not a Collection, so _sep(s) has to materialize a temporary Collection<SepBase> and bind the reference to it. Lifetime extension does not apply to a reference member initialized in a ctor-initializer: the temporary is destroyed when the constructor exits, and _sep dangles for every later use.
SepNot, which stores the same thing, holds it by value:
That is also exactly what the macOS error points at — column 42 of line 30 is _sep(s). AppleClang rejects the conversion outright; GCC and MSVC accept it and produce the dangling member instead, which is why the same defect surfaces as a compile error on one platform and as a runtime failure on the others.
2. _sep.size() is not the dimension
Collection<T> derives from std::list<std::shared_ptr<T>>, so _sep.size() is the number of separators in the collection — one — not the dimension of the domain. The test passes boxes of dimension 3, so the assertion fails on every platform that reaches it. SepNot compares against the separator's own size, set from size_of(s) in the base initializer:
tests/CMakeLists.txt registers tests through an explicit SRC_TESTS list, and core/separators/codac2_tests_SepTest is not in it (the separator entries stop at SepCartProd, SepCtcBoundary, SepInter, SepInverse, SepPolygon, SepProj, SepQInter, SepTransform, SepUnion, SepVisible). So the C++ test is compiled by no one and ctest reports 156/156 green; only the Python suite, which discovers by file name, catches the bug. Adding the entry would have caught both issues in the C++ matrix too.
Le problème venait bien du "&" en trop, merci Jordan !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Je n'ai pas fait de page dédiée dans la doc, je ne sais pas si c'est nécessaire pour ça. Au besoin j'en ferais une minimale.