Commit Graph

81 Commits

Author SHA1 Message Date
wmayer
6f23f01e50 Tests: Add unit test for PR #16763 2024-11-22 12:05:30 +01:00
wmayer
ffa3fa5b5a Core: Extend Color API
* Fix issues with alpha value <> transparency
* Use type traits to convert between different color classes (fixes #14515)
2024-11-15 12:25:25 -05:00
Kris Wilk
ffa1189634 Prevent using reserved names for properties or aliases (Fix #16846) (#16902)
* Prevent naming properties with reserved words (Fix #16846)

* Prevent using reserved constant names for properties or aliases

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

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

* App: Add unit test for isTokenAConstant

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-10-03 10:03:10 -05:00
huguesdpdn-aerospace
3795904a00 PD: Xerces-C++ - Prepare for the latest version (backward compatible) 2024-09-08 20:31:25 -05:00
bgbsww
a1ce983035 Toponaming: Missing shape hasher line; fixed cleaned Transformed 2024-08-13 07:07:59 -04:00
bgbsww
5568b40a07 Toponaming: Add missing TNP element name code; rough in more TNP tests (#14561)
* Add missing TNP element name code; rough in more TNP tests

* Update ElementNamingUtils.cpp

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-07-08 18:43:42 -05:00
Chris Hennes
d01ce32a1f Update for LibPack3 (#10337)
* cMake: Add base support for LibPack3

Minor changes to FreeCAD source code to support compiling with Qt 6.5 on MSVC,
and changes to cMake setup to support the new Libpack.

* NETGENPlugin: Fix compilation with MSVC and OCCT 7.8

* Material: Switch to Wrapped_ParseTupleAndKeywords for /fpermissive- on MSVC

* Base: Prevent accidental definition of MIN and MAX by MSVC

* cMake: Prevent accidentally finding an old LibPack

* Material: Wrap another ParseTuple call

* OCCT: Modify includes for 7.8.x

* Part: Change TNP code to use Wrapped_ParseTupleAndArgs

* Spreadsheet: Workaround for MSVC macro pollution

* Mesh: Workaround for MSVC macro pollution

* Base: Remove extra MSVC flag (moved to CMake)

* Tests: Fix compiling with /permissive-

* FEM: Fix Qt warnings about duplicate element names

* cMake: Ensure major version numbers are set

* Address review comments.

* cMake: Further tweaks for LibPack3

* cMake: Modify specification of compiler flags for MSVC

* Main: Remove QtQuick testing code

* cmake: Find Boost before SMESH (which uses it)

* Fixes for LibPack2

* cMake: Another try at importinhg VTK cleanly
2024-06-24 18:25:05 +02:00
Chris Hennes
11fa271eb5 Test: Support system GTest, and give warning if no submodule (#13662) 2024-06-03 10:40:35 -05:00
Chris Hennes
d0a4cb9a33 Tests: Disable DocumentObserverTest pending refactor
The 'normalized' test fails on Windows Conda, and the overall test class needs work.
2024-05-01 10:28:08 -05:00
CalligaroV
c3b0fcdccf App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Fixed a mistake made in getSubObjectListFlatten()
 * Applied modifications according to review comments

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
CalligaroV
243e20248d App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Formatted and refactored code imported for the DocumentObject class
 * Formatted and refactored code imported for the SubObjectT class

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
CalligaroV
ceb5478a37 App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Added test for SubObjectT::hasSubObject()
 * Added test for SubObjectT::hasSubElement()
 * Added test for SubObjectT::normalize()
 * Added test for SubObjectT::normalized()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
CalligaroV
16bdedda2f App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Added test for DocumentObject::getSubObjectList()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
Chris Hennes
2326d3ce4c Merge pull request #13495 from wwmayer/material_colors
Support to customize all material colors
2024-04-22 11:09:05 -05:00
farley
1f9f39fa28 Core: Fix searching model tree does not work for numbers #12723 (#13377)
* Fix problem #12723: Searching model tree does not work for numbers
- Modify ExpressionTokenizer::perform
- Add tests tokenizeCompletion
2024-04-22 10:55:42 -05:00
wmayer
d075a5106f Tests: add unit tests for Color class 2024-04-19 13:07:54 +02:00
wmayer
799013a9cd tests: add unit tests for VRML file with textures 2024-03-22 09:39:21 +01:00
wmayer
d3e790cf21 Tests: add test function to write to file stream 2024-03-11 16:05:30 +01:00
wmayer
81177b08e8 Test: change license of test file 2024-03-09 16:18:14 +01:00
wmayer
5af2cc89cc Tests: add tests for ProjectFile 2024-03-08 22:25:59 -06:00
wmayer
2e96599903 Tests: fix compiler warning about unused parameters 2024-03-06 15:22:21 +01:00
bgbsww
834bbff6b0 Toposhape/Part:: fix, relocate and test element methods in ComplexGeoData and TopoShape 2024-03-04 17:16:59 -05:00
Vincenzo Calligaro
0e7aa5f7bc Part/Toponaming: Tests for flushElementMap and resetElementMap (#12471)
* Part/Toponaming: tests for flushElementMap and resetElementMap
 * Added test for resetElementMap()
 * Added test for flushElementMap()
 * restored ComplexGeoData::resetElementMap to RT fork
 * modified TopoShape::resetElementMap to match the restored signature of ComplexGeoData::resetElementMap
 * added checks in TopoShape::makeShapeWithElementMap to avoid segfaults
 * added check in TopoShape::setElementComboName to avoid segfaults
 * restored testFindSubShapesForSourceWithTypeAndIndex
 * modified test saveDocFileWithNoElementMap to match the restored signature of ComplexGeoData::resetElementMap
* Part/Toponaming: tests for flushElementMap and resetElementMap
 * Removed comments in ComplexGeoData::resetElementMap()
 * Changed TopoShape::resetElementMap():: from virtual to override
 * Removed comment in TopoShape::resetElementMap()
 * Added comments about differences between main and RT fork
 * Removed comment in test saveDocFileWithNoElementMap
 * Updated expected test result in makeElementCompoundTwoShapesGeneratesMap
 * Updated expected test result in resetElementMapTest
 * Fixed typo in test flushElementMapTest
* Part/Toponaming: tests for flushElementMap and resetElementMap
 * updated expected tests results after previous methods modifications

---------

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-02-29 13:27:27 -06:00
Pieter Hijma
095e94183a [Core] Managing Custom Data Elements: VarSet (#12135)
* [Core] Add a basic VarSet document object

* [Core] Add basic tests for VarSets

* Core: Replace the VarSet icon with an outlined one
2024-02-21 10:38:06 +01:00
wmayer
260daaf24c Tests: add unit tests for all token types defined in ExpressionParser.l 2024-02-21 07:32:14 +01:00
Andrei Pozolotin
c5ad7b50b6 Resolve #11965 - no proper execute() for cross-property references
Solution B: parsequant() function
2024-02-19 11:12:52 -06:00
Chris Hennes
3df8ae2fab Revert "Resolve #11825 - no automatic quantity conversion: App::anyToQuantity"
This reverts commit 6a54591bac.
2024-02-12 15:29:15 -06:00
bgbsww
12fdd27326 Switch to using enum 2024-02-04 09:27:16 +01:00
bgbsww
9f84fbe9bb Tweak resetElementMap to default to empty defined element map (#12098)
* Tweak resetElementMap tp default to empty defined element map

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-24 21:24:08 -06:00
Chris Hennes
10d1102b84 Merge pull request #12007 from chennes/toponamingElementNameComparator
App/Toponaming: Add Comparator for mapped elements
2024-01-19 09:20:59 -06:00
Chris Hennes
32d47402b6 Tests/Toponaming: Add tests for ElementNameComparator
This verifies the existing functionality, but does not alter it. Two tests are disabled because they represent cases that the current code does not handle correctly. They are edge cases that are not expected in real code.
2024-01-16 19:25:38 -06:00
Ladislav Michl
7a955c5600 Tests: Avoid use of fmtlib when not needed 2024-01-15 17:38:56 +01:00
Andrei Pozolotin
6a54591bac Resolve #11825 - no automatic quantity conversion: App::anyToQuantity 2024-01-11 11:32:18 -06:00
Stefan Brüns
5b7fe70483 [App] Fix segfault due to missing Py_Initialize in StringIDRefTest
The PyObject desctructor requires an initialized interpreter, otherwise
PyGILState_Ensure crashes.

Fixes #11878
2024-01-10 22:34:04 -06:00
Chris Hennes
2067470b2e App/Toponaming: Add basic tests for CGD serialization 2023-11-08 17:11:32 -06:00
wmayer
0b0e9effeb tests: add initApplication() to avoid code duplications 2023-10-21 16:31:26 -05:00
wmayer
b197473842 Tests: suppress warning about intened self-assignment 2023-10-11 15:12:42 +02:00
wmayer
e6bd1f10e9 App: the function findLicense() uses the '==' operator to compare two C strings.
This is wrong and leads to failures under Windows.
2023-10-10 13:31:10 +02:00
Chris Hennes
e36e16de59 Merge pull request #10667 from chennes/toponamingHasherToDocument
App/Toponaming: Add StringHasher to Document
2023-09-20 13:31:02 -05:00
Pesc0
108e2c175f fix qbytearray length out of bound 2023-09-19 12:38:27 -05:00
wmayer
ecad77057a Tests: fix a memory leak in StringIDRefTest::getPyObject 2023-09-18 14:58:38 +02:00
Chris Hennes
ef91d82daf App/Toponaming: Add a few tests for Document 2023-09-17 13:13:37 -05:00
Chris Hennes
2a386c9f6f App/Toponaming: Add StringHasher to Document 2023-09-17 13:13:37 -05:00
pre-commit-ci[bot]
222a2520b1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-12 13:02:35 -04:00
Chris Hennes
1a960286a4 Tests: Reformat to current clang-format standard 2023-09-03 09:51:42 -05:00
wmayer
d623e37e5e Test: add more unit tests 2023-08-26 13:17:53 +02:00
Chris Hennes
2ad35ea03e App/Toponaming: Add tests for findTagInElementName
Also apply clang-tidy to that function, and fix an error with the postfix return.
2023-07-15 22:47:08 -05:00
Chris Hennes
e7f8f26bd5 App/Toponaming: Basic tests and linter issues 2023-07-14 23:03:18 -05:00
Pesc0
4a8d3853ba [Toponaming] create ElementMap class (#9175)
* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
2023-06-15 09:05:24 -05:00
Chris Hennes
43abb34698 App/Toponaming: Adjust StringHasher tests 2023-05-11 16:41:52 -05:00