Commit Graph

119 Commits

Author SHA1 Message Date
wmayer
aa5bea4e2e Base: add method XMLReader::isStartOfDocument() 2023-10-12 19:46:21 +02:00
wmayer
dcfd888c8f Tests: extend some reader tests after fixing givenDataAsXMLStream 2023-10-12 12:07:47 +02:00
wmayer
b197473842 Tests: suppress warning about intened self-assignment 2023-10-11 15:12:42 +02:00
wmayer
be2aa179b1 Tests: fix undefined behaviour in givenDataAsXMLStream 2023-10-11 12:05:37 +02:00
Chris Hennes
9b11c36708 Base/Toponaming: Refactor to extract filters to new file 2023-10-10 11:28:30 -05:00
Chris Hennes
5975e3d51e App/Toponaming: Add base64 encoding to XML 2023-10-10 10:19:43 -05: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
wmayer
1312b9d2ac Tests: add unit tests for XMLReader::readNextElement() 2023-10-09 15:06:45 +02:00
Jolbas
40228d9ef2 Matrix.decompose() fix
Fixes some errors when matrix has zero scale in one or two directions
2023-09-28 15:25:29 -05:00
Jolbas
2d8c280528 Create rotation from any matrix
To help find a matrix components a decompose method is added to Matrix class
2023-09-28 15:25:29 -05:00
wmayer
0d7880a902 Mat: fix several compiler warnings:
* -Winconsistent-missing-override
* -Wtautological-undefined-compare
2023-09-27 21:38:56 -05:00
Chris Hennes
dcbb74a0f2 Merge pull request #10690 from davesrocketshop/material_merge
Material: Material handling enhancements
2023-09-27 16:15:06 -05:00
howie-j
acbf135b78 [Sketcher] Fix angle constraint expression regression (#10743)
* fix 10742

* moved expression string modifier to helper function

* Tests: Add example tests for SketchObject

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

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

* made expr modifier func static, pass by value and added unit tests

---------

Co-authored-by: Chris Hennes <chennes@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-25 10:44:31 -05:00
David Carter
442bca834e Material: Material handling enhancements
Rework of the material handling system.

This first part concntrates on a rework of the material cards.
Rather than use a fixed list of possible properties, properties can
be defined separately in their own files and mixed to provide a
complete list of possible properties. Properties can be inherited.

The cards then provide values for the properties. These can also
be inherited allowing for small changes in cards as required.

The new property definitions are more extensive than previously.
2 and 3 dimensional arrays of properties can be defined. Values
are obtained by calling an API instead of reading from a dictionary.

For compatibility, a Python dictionary of values can be obtained
similar to how it was done previously, but this is considered a
deprecated API and won't support the newer advanced features.

The editor is completely reworked. It will be able to edit older format
material cards, but can only save them in the new format.

For testing during the development phase, a system preference can
specifiy wether the old or new material editors are to be used. This
option will be removed before release.
2023-09-25 11:04:15 -04:00
David Carter
6624fa3775 Material: Material handling enhancements
Rework of the material handling system.

This first part concntrates on a rework of the material cards.
Rather than use a fixed list of possible properties, properties can
be defined separately in their own files and mixed to provide a
complete list of possible properties. Properties can be inherited.

The cards then provide values for the properties. These can also
be inherited allowing for small changes in cards as required.

The new property definitions are more extensive than previously.
2 and 3 dimensional arrays of properties can be defined. Values
are obtained by calling an API instead of reading from a dictionary.

For compatibility, a Python dictionary of values can be obtained
similar to how it was done previously, but this is considered a
deprecated API and won't support the newer advanced features.

The editor is completely reworked. It will be able to edit older format
material cards, but can only save them in the new format.

For testing during the development phase, a system preference can
specifiy wether the old or new material editors are to be used. This
option will be removed before release.
2023-09-25 11:04:01 -04: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
wmayer
d567b859d3 Tests: add some more unit tests for Matrix class 2023-09-18 01:21:07 +02:00
wmayer
4f6ab508d7 Base: fix incorrect method names of Matrix class about diagonal and trace 2023-09-18 01:21:07 +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
wmayer
89bb28239e MSVC: fix several compiler warnings 2023-09-12 22:57:26 +02: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
9fc5c2d8e4 Base: fixes #10462: mesh.unite() causes segementaion fault 2023-09-03 11:14:34 +02:00
wmayer
0b63d0cecb Tests: move Sketcher test target to appropriate CMakeLists.txt file 2023-08-28 09:12:26 -05:00
wmayer
8a59350de8 Mesh: add unit tests 2023-08-27 18:55:02 +02:00
wmayer
908af28eb3 Points: add unit tests 2023-08-27 18:55:02 +02:00
wmayer
d6a0732032 Base: add unit tests 2023-08-27 18:55:02 +02:00
wmayer
90bafb3a06 Base: add methods to get volume and get max/min points 2023-08-27 03:11:00 +02:00
wmayer
d623e37e5e Test: add more unit tests 2023-08-26 13:17:53 +02:00
wmayer
423cc42ac8 Tests: add unit tests for:
* TopoShape::getElementTypeAndIndex
* ComplexGeoData::getTypeAndIndex

and fix crashes there when passing a null pointer
2023-08-25 19:23:18 +02:00
Chris Hennes
ee7779455a Test: Begin QuantitySpinBox QTests 2023-08-12 10:23:43 -07:00
Jonas Bähr
321c448c39 Fix build of "tests" on macOS
Building the C++ unit tests failed for
 tests/src/Mod/Sketcher/App/SketchObject.cpp
because some XML headers were not found. This was because the XercesC
include dir was not in the search list for headers.

Details:
> In file included from /Users/jonas/src/FreeCAD/FreeCAD-git/tests/src/Mod/Sketcher/App/SketchObject.cpp:7:
> In file included from /Users/jonas/src/FreeCAD/FreeCAD-git/src/App/Application.h:33:
> /Users/jonas/src/FreeCAD/FreeCAD-git/src/Base/Parameter.h:55:10: fatal error: 'xercesc/util/XercesDefs.hpp' file not found
> #include <xercesc/util/XercesDefs.hpp>
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is the same issue as already adresses previously with PR9657 [1] but
the test for SketchObject was added later [2].

[1]: https://github.com/FreeCAD/FreeCAD/pull/9657
[2]: 532b391b69
2023-08-11 06:33:38 -07:00
Jonas Bähr
e3de4f217c minor reformat: break lines, one per item 2023-08-11 06:33:38 -07:00
wmayer
1dd8680b11 gcc: support to build with v7.5 2023-08-10 11:22:08 +02:00
wmayer
57c213b464 MSVC: fix build failure caused by PR #10138 2023-08-09 18:17:32 +02:00
wmayer
3b6a01095f fixes #10127: Usage of std::filesystem in test bumps minimum GCC version to GCC 8 2023-08-09 13:52:42 +02:00
berniev
64f9251cae link gmock 2023-08-04 18:48:33 -06:00
wmayer
3975f31f89 Misc: modernize C++: use override 2023-08-04 17:09:53 +02:00
sliptonic
20768ba7f9 Merge pull request #9594 from wwmayer/issue_9549_new
Part: fixes #9549: Part Fuse not working inside Part container
2023-07-24 10:16:51 -05:00
Ajinkya Dahale
2167fb6f7e [Sketcher] [gtest] Add gtests for geoIdFromShapeType 2023-07-21 22:43:45 -05:00
Ajinkya Dahale
532b391b69 [Sketcher] [gtest] Add SketchObject test
Create a document and then add a `SketchObject` to it. Does not work without
creating document.

Also `FCConfig.h` is needed for `FC_OS_WIN32`.
2023-07-21 22:43:45 -05: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
Jonas Bähr
b1782ee3d6 Fix build of "tests" on macOS
Building the C++ unit tests failed for
 tests/src/App/Metadata.cpp
 tests/src/Base/Reader.cpp
because some XML headers were not found. This was because the XercesC
include dir was not in the search list for headers.
I cannot say why only macOS seems to be affected, but it's not the first
time, see e.g a1776d3e74
2023-06-08 10:57:13 -04:00
wmayer
41e6758bc0 Base: add helper function to quote a string and join a list of strings 2023-05-15 23:40:07 +02:00
Chris Hennes
43abb34698 App/Toponaming: Adjust StringHasher tests 2023-05-11 16:41:52 -05:00