Commit Graph

9 Commits

Author SHA1 Message Date
Weston Schmidt
140c9febc4 Add test causing crash and fix map sorting function. (#22889)
* Add test causing crash and fix map sorting function.

When opening a model from FreeCAD 0.7, the model would crash when I
changed some of the parameters.  This turned out to be due to the
ElementNameComparator::operator() not correctly sorting the items going
into the map, which caused the map to be invalid.

This change adds a test that represented the exact names causing the
crash as well as a fix for the problem.  Names are now sorted:

1. Empty names first
2. Identifier based names second.
3. Hex based names last.

Identifiers are sorted lexicographically for the name portion and
numerically for the number portion, smallest to largest.

Hex based names are sorted by the value of the hex number, smallest to
largest.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix lint issues.

* Add another test form to the mix.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-05 14:07:02 -05:00
wmayer
4e82a0af48 App: Apply clang format (part 1) 2024-11-21 07:54:24 +01:00
bgbsww
3df25821e5 Toposhape/Part:: Fix, relocate and test element methods in ComplexGeoData and TopoShape 2024-03-07 23:00:48 -05:00
bgbsww
541ec563e3 Merge branch 'main' into bgbsww-toponaming-makeElementFace 2024-01-21 15:52:31 -05:00
Zheng, Lei
f4cc2df2bd Toponaming move makEFace as makeElementFace and dependencies 2024-01-17 20:38:50 -05:00
Chris Hennes
c999f887eb App/Toponaming: ElementNameComparator linter cleanup
Does not address cognitive complexity.
2024-01-15 21:50:32 -06:00
Zheng, Lei
ef2ef6d7aa App/Toponaming: Add Comparator for mapped elements
This is the original code from the Toponaming branch, modified slightly to update the
method name and correct some grammatical errors in the descriptive comment.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-01-15 21:28:02 -06:00
Chris Hennes
8b74cd3255 App/Toponaming: Add tests to MappedElement 2023-03-24 10:05:09 -05:00
Chris Hennes
39d2be72d4 App/Toponaming: Add MappedElement class 2023-03-23 09:46:32 -05:00