[packages/FreeCAD] Rel 4. Enable PCL, tests bcond, binaries Fedora way (so tests work)

arekm arekm at pld-linux.org
Mon Sep 28 18:03:16 CEST 2026


commit fff175b2a4bc86e9c3b3f28c790eefa50c2fb22f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Sep 28 09:20:37 2026 +0200

    Rel 4. Enable PCL, tests bcond, binaries Fedora way (so tests work)

 FreeCAD.spec            | 115 ++++++++++++++++++++++++------------------
 apphome.patch           |  29 -----------
 cam-offset-occ793.patch | 129 ++++++++++++++++++++++++++++++++++++++++++++++++
 test-lineformat.patch   |  96 +++++++++++++++++++++++++++++++++++
 4 files changed, 292 insertions(+), 77 deletions(-)
---
diff --git a/FreeCAD.spec b/FreeCAD.spec
index cf75125..14d4742 100644
--- a/FreeCAD.spec
+++ b/FreeCAD.spec
@@ -1,40 +1,42 @@
 # TODO:
-# - OpenMPI (ompi-cxx)?
-# - BUILD_CLOUD?
-# - BUILD_DRAWING?
-# - BUILD_JTREADER?
-# - BUILD_MATERIAL_EXTERNAL?
-# - BUILD_VR? (BR: OCULUS/Rift SDK 4.x)
-# - FREECAD_USE_EXTERNAL_KDL? (BR: pkgconfig(orocos-kdl) >= 1.4.0, pkgconfig(orocos-kdltk-*) >= 1.4.0)
-# - FREECAD_USE_EXTERNAL_ONDSELSOLVER? (BR: OndselSolver)
-# - FREECAD_USE_EXTERNAL_PYCXX?
-# - FREECAD_USE_PCL? (BR: pcl-devel components: common kdtree features surface io filters segmentation sample_consensus)
-# - USE_CUDA on bcond?
-# - USE_OPENCV?
+# - BUILD_MATERIAL_EXTERNAL? (bundled lru-cache only)
+#
+# Not applicable:
+# - BUILD_CLOUD (does not compile, removed upstream: https://github.com/FreeCAD/FreeCAD/pull/30651)
+# - BUILD_DRAWING, BUILD_JTREADER, BUILD_VR (modules absent from the tarball)
+# - FREECAD_USE_EXTERNAL_KDL (lookup commented out upstream, bundled kdl is extended)
+# - FREECAD_USE_EXTERNAL_ONDSELSOLVER (FreeCAD-only submodule without releases of its own)
+# - FREECAD_USE_EXTERNAL_PYCXX (pkgconfig-only; PLD PyCXX ships no .pc, paths passed directly)
+# - OpenMPI (only for med built with MPI)
+# - USE_CUDA, USE_OPENCV (no build logic behind them)
 #
 # Conditional build:
+%bcond_without	pcl		# PCL-based reverse engineering features
 %bcond_with	system_smesh	# system version of Salome's Mesh
 %bcond_with	system_zipios	# system version of zipios++
+%bcond_without	tests		# unit tests
 
 Summary:	A general purpose 3D CAD modeler
 Summary(pl.UTF-8):	Modeler CAD 3D ogólnego przeznaczenia
 Name:		FreeCAD
 Version:	1.1.3
-Release:	3
+Release:	4
 License:	LGPL v2
 Group:		Applications/Engineering
 Source0:	https://github.com/FreeCAD/FreeCAD/releases/download/%{version}/freecad_source_%{version}.tar.gz
 # Source0-md5:	355c28ccdabc1afedc9adbc247c490bf
-Patch0:		apphome.patch
 Patch1:		external-E57Format.patch
 Patch2:		FreeCAD-netgen.patch
+Patch3:		test-lineformat.patch
+Patch4:		cam-offset-occ793.patch
 URL:		https://freecad.org/
 BuildRequires:	Coin-devel
-BuildRequires:	FreeImage-devel
-BuildRequires:	OpenCASCADE-devel
+# 7.8 cmake exports linked draco, FreeImage, freetype, tk, X11 by path/name; 7.9 exports only OCC and VTK targets
+BuildRequires:	OpenCASCADE-devel >= 7.9.3
 BuildRequires:	OpenGL-devel
 BuildRequires:	OpenGL-GLU-devel
-BuildRequires:	PyCXX
+# 7.1.x uses _Py_PackageContext, gone from Python 3.13 headers
+BuildRequires:	PyCXX >= 7.2.0
 BuildRequires:	Qt6Concurrent-devel >= 6
 BuildRequires:	Qt6Core-devel >= 6
 BuildRequires:	Qt6Designer-devel >= 6
@@ -42,6 +44,7 @@ BuildRequires:	Qt6Network-devel >= 6
 BuildRequires:	Qt6OpenGL-devel >= 6
 BuildRequires:	Qt6PrintSupport-devel >= 6
 BuildRequires:	Qt6Svg-devel >= 6
+%{?with_tests:BuildRequires:	Qt6Test-devel >= 6}
 BuildRequires:	Qt6UiTools-devel >= 6
 BuildRequires:	Qt6Widgets-devel >= 6
 BuildRequires:	Qt6Xml-devel >= 6
@@ -51,38 +54,27 @@ BuildRequires:	boost-devel >= 1:1.85.0
 BuildRequires:	boost-python-devel-common >= 1:1.85.0
 BuildRequires:	boost-python3-devel >= 1:1.85.0
 BuildRequires:	cmake >= 3.22.0
-BuildRequires:	cups-devel
 BuildRequires:	desktop-file-utils
-BuildRequires:	dos2unix
-BuildRequires:	double-conversion-devel
-BuildRequires:	doxygen
-BuildRequires:	draco-devel
 BuildRequires:	eigen3 >= 3.4.0
-BuildRequires:	expat-devel >= 1.95
-BuildRequires:	ffmpeg-devel >= 6.0
 BuildRequires:	freetype-devel >= 2
 BuildRequires:	gcc-fortran
-BuildRequires:	gettext-tools
-BuildRequires:	glew-devel
-BuildRequires:	graphviz
+%{?with_tests:BuildRequires:	gmock-devel}
+%{?with_tests:BuildRequires:	gtest-devel}
 BuildRequires:	hdf5-devel
-BuildRequires:	hdf5-c++-devel
 BuildRequires:	libE57Format-devel
 BuildRequires:	libfmt-devel
 # OpenMP >= 4.0
 BuildRequires:	libgomp-devel >= 6:5
 BuildRequires:	libicu-devel
-BuildRequires:	libjpeg-devel
-BuildRequires:	libpng-devel
 BuildRequires:	libspnav-devel
 BuildRequires:	libstdc++-devel >= 6:11.2
-BuildRequires:	libtiff-devel
-BuildRequires:	lz4-devel
 BuildRequires:	med-devel
-BuildRequires:	netcdf-cxx4-devel
-BuildRequires:	netgen-mesher-devel >= 6.2
+# FreeCAD-netgen.patch uses Segment::EPGeomInfo() accessors, absent in 6.2.2404
+BuildRequires:	netgen-mesher-devel >= 6.2.2607
 # not needed at the moment
 #BuildRequires:	opencv-devel
+# 1.14.1-3 ships Modules/ that PCLConfig.cmake includes
+%{?with_pcl:BuildRequires:	pcl-devel >= 1.14.1-3}
 BuildRequires:	pkgconfig
 BuildRequires:	python3-PySide6 >= 6
 BuildRequires:	python3-devel >= 1:3.10
@@ -97,12 +89,12 @@ BuildRequires:	rpmbuild(macros) >= 2.047
 BuildRequires:	shiboken6 >= 6
 %{?with_system_smesh:BuildRequires:  smesh-devel >= 7.7.1}
 BuildRequires:	swig
-BuildRequires:	tbb-devel
-BuildRequires:	vtk-devel >= 6.2
-BuildRequires:	vtk-python3-devel >= 6.2
+# 9.3.1-20 -devel pulls in the -devels vtk-config.cmake runs find_package() for
+BuildRequires:	vtk-devel >= 9.3.1-20
+# 9.3.1-21 fixes the Python 3.13 segfault on import (FEM tests import vtkmodules)
+BuildRequires:	vtk-python3-devel >= 9.3.1-21
 BuildRequires:	xerces-c-devel
 BuildRequires:	xorg-lib-libX11-devel
-BuildRequires:	xz-devel
 BuildRequires:	yaml-cpp-devel
 %{?with_system_zipios:BuildRequires:	zipios++-devel}
 BuildRequires:	zlib-devel
@@ -111,6 +103,9 @@ Requires:	glib2 >= 1:2.26.0
 Requires:	hicolor-icon-theme
 Requires:	python3-PySide6
 Requires:	python3-matplotlib
+# FEM Netgen mesher runs a python script importing netgen.occ/pyngcore/numpy
+Requires:	python3-netgen-mesher
+Requires:	python3-numpy
 Requires:	python3-pivy
 Requires:	python3-pivy-gui
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -163,30 +158,34 @@ GUI instancji FreeCAD-a tak, jak innych widżetów Qt.
 
 %prep
 %setup -q -c
-%patch -P0 -p1
 %patch -P1 -p1
 %patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
 
 # don't force color diagnostics if output is not terminal
 %{__sed} -i -e 's/-fdiagnostics-color //' cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake
 
 %build
 #	-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
+# install dirs relative to AppHomePath (the binary location), so data and libs are found from the build tree too
 %cmake -B build \
 	-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
-	-DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
+	-DCMAKE_INSTALL_BINDIR=bin \
+	-DCMAKE_INSTALL_DATADIR=../../share/%{name} \
 	-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
 	-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
-	-DCMAKE_INSTALL_LIBDIR=%{_libdir}/%{name}/lib \
-	-DAPPHOMEPATH=%{_libdir}/%{name} \
-	-DLIBRARYDIR=%{_libdir}/%{name}/lib \
-	-DRESOURCEDIR=%{_datadir}/%{name} \
+	-DCMAKE_INSTALL_LIBDIR=lib \
 	-DBUILD_DESIGNER_PLUGIN=ON \
 	-DBUILD_FEM_NETGEN=ON \
-	-DENABLE_DEVELOPER_TESTS=OFF \
+	-DENABLE_DEVELOPER_TESTS=%{__ON_OFF tests} \
 	-DFREECAD_QT_MAJOR_VERSION=6 \
 	-DFREECAD_USE_EXTERNAL_E57FORMAT=ON \
+	-DFREECAD_USE_EXTERNAL_GTEST=ON \
 	-DFREECAD_USE_EXTERNAL_ZIPIOS=%{__ON_OFF system_zipios} \
+	-DFREECAD_USE_PCL=%{__ON_OFF pcl} \
+	-DPYCXX_INCLUDE_DIRS=%{py3_incdir} \
+	-DPYCXX_SOURCE_DIR=%{_datadir}/python%{py3_ver}/CXX \
 	-DQT_DEFAULT_MAJOR_VERSION=6 \
 %if %{with system_smesh}
 	-DFREECAD_USE_EXTERNAL_SMESH=ON \
@@ -195,12 +194,28 @@ GUI instancji FreeCAD-a tak, jak innych widżetów Qt.
 
 %{__make} -C build
 
+%if %{with tests}
+# user config and caches go to $HOME
+export HOME=$(pwd)/build/tests-home
+export QT_QPA_PLATFORM=offscreen
+ctest --test-dir build --output-on-failure %{?_smp_mflags} -E FileInfoTest
+# FileInfoTest cases share one scratch dir, https://github.com/FreeCAD/FreeCAD/issues/28737
+ctest --test-dir build --output-on-failure -R FileInfoTest
+build/bin/FreeCADCmd -t 0
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
 %{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+# AppHomePath is derived from the real path of the binary
+install -d $RPM_BUILD_ROOT%{_bindir}
+for f in FreeCAD FreeCADCmd freecad-thumbnailer; do
+	ln -s %{_libdir}/%{name}/bin/$f $RPM_BUILD_ROOT%{_bindir}/$f
+done
+
 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
 
 %{__rm} -r $RPM_BUILD_ROOT{%{_includedir},%{_npkgconfigdir}}
@@ -229,10 +244,14 @@ rm -rf $RPM_BUILD_ROOT
 %doc README.md SECURITY.md
 %doc build/usr/share/doc/FreeCAD/LICENSE.html
 %doc build/usr/share/doc/FreeCAD/ThirdPartyLibraries.html
-%attr(755,root,root) %{_bindir}/FreeCAD
-%attr(755,root,root) %{_bindir}/FreeCADCmd
-%attr(755,root,root) %{_bindir}/freecad-thumbnailer
+%{_bindir}/FreeCAD
+%{_bindir}/FreeCADCmd
+%{_bindir}/freecad-thumbnailer
 %dir %{_libdir}/%{name}
+%dir %{_libdir}/%{name}/bin
+%attr(755,root,root) %{_libdir}/%{name}/bin/FreeCAD
+%attr(755,root,root) %{_libdir}/%{name}/bin/FreeCADCmd
+%attr(755,root,root) %{_libdir}/%{name}/bin/freecad-thumbnailer
 %{_libdir}/%{name}/Ext
 %{_libdir}/%{name}/Mod
 %dir %{_libdir}/%{name}/lib
diff --git a/apphome.patch b/apphome.patch
deleted file mode 100644
index dc96ea0..0000000
--- a/apphome.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- FreeCAD-1.0.0/src/App/Application.cpp~	2024-11-18 19:38:15.000000000 +0100
-+++ FreeCAD-1.0.0/src/App/Application.cpp	2024-12-28 23:34:27.863331562 +0100
-@@ -2512,9 +2512,13 @@
- void Application::initConfig(int argc, char ** argv)
- {
-     // find the home path....
-+#ifdef APPHOMEPATH
-+    mConfig["AppHomePath"] = APPHOMEPATH;
-+#else
-     mConfig["AppHomePath"] = Base::FileInfo::pathToString(
-         ApplicationDirectories::findHomePath(argv[0])
-     );
-+#endif
- 
-     // Version of the application extracted from SubWCRef into src/Build/Version.h
-     // We only set these keys if not yet defined. Therefore it suffices to search
---- FreeCAD-1.0.0/src/App/CMakeLists.txt~	2024-11-18 19:38:15.000000000 +0100
-+++ FreeCAD-1.0.0/src/App/CMakeLists.txt	2024-12-28 23:35:12.736664896 +0100
-@@ -20,6 +20,10 @@
-     add_definitions(-DDOCDIR="${DOCDIR}")
- ENDIF(DOCDIR)
- 
-+IF(APPHOMEPATH)
-+	add_definitions(-DAPPHOMEPATH="${APPHOMEPATH}/")
-+ENDIF(APPHOMEPATH)
-+
- # -----------------------------------------------------------------------------
- 
- #write relevant cmake variables to a file for later access with python. Exported are all variables
diff --git a/cam-offset-occ793.patch b/cam-offset-occ793.patch
new file mode 100644
index 0000000..df5a523
--- /dev/null
+++ b/cam-offset-occ793.patch
@@ -0,0 +1,129 @@
+# a18f77f3b8 (#28038) rebased on 1.1.3: TestTestPost.py part dropped (file absent), old type() comparison in context
+From a18f77f3b81c15677973e2ea14274c73200470f1 Mon Sep 17 00:00:00 2001
+From: FilippoR <filippo.rossoni at gmail.com>
+Date: Fri, 6 Mar 2026 18:31:05 +0100
+Subject: [PATCH] fix CAMTests.TestPathOpUtil.TestPathOpUtil.test46 & test47
+ (#28038)
+
+* fix CAMTests.TestPathOpUtil.TestPathOpUtil.test46
+
+* fix CAMTests.TestPathOpUtil.TestPathOpUtil.test47
+
+* disable CAMTests.TestTestPost.TestTestPost.test00190
+---
+ src/Mod/CAM/CAMTests/TestPathOpUtil.py | 45 ++++++++++++++++----------
+ src/Mod/CAM/CAMTests/TestTestPost.py   |  2 ++
+ src/Mod/CAM/Path/Op/Util.py            | 22 +++++++------
+ 3 files changed, 42 insertions(+), 27 deletions(-)
+diff --git a/src/Mod/CAM/CAMTests/TestPathOpUtil.py b/src/Mod/CAM/CAMTests/TestPathOpUtil.py
+index 8bf7e3748007..87867b1d9686 100644
+--- a/src/Mod/CAM/CAMTests/TestPathOpUtil.py
++++ b/src/Mod/CAM/CAMTests/TestPathOpUtil.py
+@@ -815,12 +815,11 @@ def test46(self):
+ 
+     def test47(self):
+         """Check offsetting multiple backwards inside edges."""
+-        # This is exactly the same as test36 except that the wire is flipped to make
+-        # sure it's orientation doesn't matter
++        # This is similar to test46 except that the wire is flipped to verify
++        # that wire offsetting works regardless of input wire orientation
+         obj = self.doc.getObjectsByLabel("offset-edge")[0]
+ 
+         w = getWireInside(obj)
+-        length = 20 * math.cos(math.pi / 6)
+ 
+         # let's offset the other two legs
+         lEdges = [
+@@ -830,26 +829,38 @@ def test47(self):
+         ]
+         self.assertEqual(2, len(lEdges))
+ 
++        # Test with flipped wire - the algorithm should handle it
+         w = Path.Geom.flipWire(Part.Wire(lEdges))
+         wire = PathOpUtil.offsetWire(w, obj.Shape, 2, True)
+ 
+-        x = length / 2 - 2 * math.cos(math.pi / 6)
+-        y = -5 - 2 * math.sin(math.pi / 6)
+-
+-        self.assertCoincide(Vector(+x, y, 0), wire.Edges[0].Vertexes[0].Point)
+-        self.assertCoincide(Vector(-x, y, 0), wire.Edges[-1].Vertexes[1].Point)
+-
+-        rEdges = [e for e in wire.Edges if Part.Circle == type(e.Curve)]
+-        self.assertEqual(0, len(rEdges))
++        # Check structural properties rather than exact coordinates
++        # Verify the wire is valid and has geometry
++        self.assertIsNotNone(wire)
++        self.assertGreater(len(wire.Edges), 0)
++        # All edges should be lines (no circles for inside edges)
++        lEdges_result = [e for e in wire.Edges if isinstance(e.Curve, Part.Line)]
++        self.assertGreater(len(lEdges_result), 0)
++        # Check that edge lengths are consistent with offset geometry
++        total_length = 0
++        for e in wire.Edges:
++            self.assertGreater(e.Length, 0)
++            total_length += e.Length
++        # Result should have meaningful length after offset
++        self.assertGreater(total_length, 0)
+ 
+-        # offset the other way
++        # offset the other way - this should also work
+         wire = PathOpUtil.offsetWire(Part.Wire(lEdges), obj.Shape, 2, False)
+ 
+-        self.assertCoincide(Vector(-x, y, 0), wire.Edges[0].Vertexes[0].Point)
+-        self.assertCoincide(Vector(+x, y, 0), wire.Edges[-1].Vertexes[1].Point)
+-
+-        rEdges = [e for e in wire.Edges if Part.Circle == type(e.Curve)]
+-        self.assertEqual(0, len(rEdges))
++        # Check the same structural properties
++        self.assertIsNotNone(wire)
++        self.assertGreater(len(wire.Edges), 0)
++        lEdges_result = [e for e in wire.Edges if isinstance(e.Curve, Part.Line)]
++        self.assertGreater(len(lEdges_result), 0)
++        total_length = 0
++        for e in wire.Edges:
++            self.assertGreater(e.Length, 0)
++            total_length += e.Length
++        self.assertGreater(total_length, 0)
+ 
+     def test50(self):
+         """Orient an already oriented wire"""
+diff --git a/src/Mod/CAM/Path/Op/Util.py b/src/Mod/CAM/Path/Op/Util.py
+index 5035371c1c90..db4b8cdf4c1e 100644
+--- a/src/Mod/CAM/Path/Op/Util.py
++++ b/src/Mod/CAM/Path/Op/Util.py
+@@ -345,7 +345,8 @@ def isInside(edge):
+         if not longestWire or longestWire.Length < w.Length:
+             longestWire = w
+ 
+-    debugWire("outside", Part.Wire(outside))
++    if len(outside) >= 2:
++        debugWire("outside", Part.Wire(outside))
+     debugWire("longest", longestWire)
+ 
+     def isCircleAt(edge, center):
+@@ -398,15 +399,16 @@ def isCircleAt(edge, center):
+     # figure out if all the left sided edges or the right sided edges are the ones
+     # that are 'outside'. However, we return the full side.
+     edges = leftSideEdges
+-    for e in longestWire.Edges:
+-        for e0 in rightSideEdges:
+-            if Path.Geom.edgesMatch(e, e0):
+-                edges = rightSideEdges
+-                Path.Log.debug("#use right side edges")
+-                if not forward:
+-                    Path.Log.debug("#reverse")
+-                    edges.reverse()
+-                return orientWire(Part.Wire(edges), None)
++    if longestWire:
++        for e in longestWire.Edges:
++            for e0 in rightSideEdges:
++                if Path.Geom.edgesMatch(e, e0):
++                    edges = rightSideEdges
++                    Path.Log.debug("#use right side edges")
++                    if not forward:
++                        Path.Log.debug("#reverse")
++                        edges.reverse()
++                    return orientWire(Part.Wire(edges), None)
+ 
+     # at this point we have the correct edges and they are in the order for forward
+     # traversal (climb milling). If that's not what we want just reverse the order,
diff --git a/test-lineformat.patch b/test-lineformat.patch
new file mode 100644
index 0000000..fca0740
--- /dev/null
+++ b/test-lineformat.patch
@@ -0,0 +1,96 @@
+From e9b4a1c4bfdb7d08f4f3dc4c7a8df4e3bc2cb284 Mon Sep 17 00:00:00 2001
+From: filippor <filippo.rossoni at gmail.com>
+Date: Tue, 31 Mar 2026 14:01:49 +0200
+Subject: [PATCH] TechDraw: Fix TestLineFormat and intialize preferences
+
+---
+ tests/src/Mod/TechDraw/App/LineFormat.cpp | 54 ++++++++++++++++-------
+ 1 file changed, 39 insertions(+), 15 deletions(-)
+
+diff --git a/tests/src/Mod/TechDraw/App/LineFormat.cpp b/tests/src/Mod/TechDraw/App/LineFormat.cpp
+index b84cd377b2c4..3b005b60b6d0 100644
+--- a/tests/src/Mod/TechDraw/App/LineFormat.cpp
++++ b/tests/src/Mod/TechDraw/App/LineFormat.cpp
+@@ -4,43 +4,67 @@
+ #include <QtCore/Qt>
+ 
+ #include "Mod/TechDraw/App/LineFormat.h"
++#include "src/App/InitApplication.h"
+ 
+-namespace
++class TestLineFormat: public ::testing::Test
+ {
++protected:
++    static void SetUpTestSuite()
++    {
++        tests::initApplication();
++    }
++    void SetUp() override
++    {
++        _lineFormat = std::make_unique<TechDraw::LineFormat>(
++            Qt::SolidLine,
++            0.5,
++            Base::Color(0.0F, 0.0F, 0.0F, 1.0F),
++            true
++        );
++    }
++    void TearDown() override
++    {
+ 
+-TechDraw::LineFormat makeLineFormat()
+-{
+-    return {Qt::SolidLine, 0.5, Base::Color(0.0F, 0.0F, 0.0F, 1.0F), true};
+-}
++        _lineFormat.reset();
++    }
++
++    /// Get a non-owning pointer to the internal LineFormat for this test
++    TechDraw::LineFormat* lineFormat()
++    {
++        return _lineFormat.get();
++    }
++
++private:
++    std::unique_ptr<TechDraw::LineFormat> _lineFormat;
++};
+ 
+-}  // namespace
+ 
+-TEST(TestLineFormat, setQColorKeepsOpaqueColorsOpaque)
++TEST_F(TestLineFormat, setQColorKeepsOpaqueColorsOpaque)
+ {
+-    auto format = makeLineFormat();
++    auto format = lineFormat();
+ 
+-    format.setQColor(QColor(255, 0, 0, 255));
++    format->setQColor(QColor(255, 0, 0, 255));
+ 
+-    const Base::Color stored = format.getColor();
++    const Base::Color stored = format->getColor();
+     EXPECT_FLOAT_EQ(stored.r, 1.0F);
+     EXPECT_FLOAT_EQ(stored.g, 0.0F);
+     EXPECT_FLOAT_EQ(stored.b, 0.0F);
+     EXPECT_FLOAT_EQ(stored.a, 1.0F);
+ 
+-    const QColor roundTripped = format.getQColor();
++    const QColor roundTripped = format->getQColor();
+     EXPECT_EQ(roundTripped.red(), 255);
+     EXPECT_EQ(roundTripped.green(), 0);
+     EXPECT_EQ(roundTripped.blue(), 0);
+     EXPECT_EQ(roundTripped.alpha(), 255);
+ }
+ 
+-TEST(TestLineFormat, setQColorPreservesAlphaValue)
++TEST_F(TestLineFormat, setQColorPreservesAlphaValue)
+ {
+-    auto format = makeLineFormat();
++    auto format = lineFormat();
+ 
+-    format.setQColor(QColor(12, 34, 56, 78));
++    format->setQColor(QColor(12, 34, 56, 78));
+ 
+-    const QColor roundTripped = format.getQColor();
++    const QColor roundTripped = format->getQColor();
+     EXPECT_EQ(roundTripped.red(), 12);
+     EXPECT_EQ(roundTripped.green(), 34);
+     EXPECT_EQ(roundTripped.blue(), 56);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/FreeCAD.git/commitdiff/fff175b2a4bc86e9c3b3f28c790eefa50c2fb22f



More information about the pld-cvs-commit mailing list