Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lib2geom for openSUSE:Factory checked in at 2023-01-07 17:16:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lib2geom (Old) and /work/SRC/openSUSE:Factory/.lib2geom.new.1563 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lib2geom" Sat Jan 7 17:16:03 2023 rev:2 rq:1056330 version:1.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/lib2geom/lib2geom.changes 2021-06-29 22:44:01.542934297 +0200 +++ /work/SRC/openSUSE:Factory/.lib2geom.new.1563/lib2geom.changes 2023-01-07 17:16:22.812962496 +0100 @@ -1,0 +2,7 @@ +Sun Dec 18 14:52:12 UTC 2022 - th...@gmx.de + +- Update to version 1.2.2 + * Remove assertions in the intersection routine for EllipticalArc + * fix-floating-point-epsilon-in-tests-i586.patch fixed upstream + +------------------------------------------------------------------- Old: ---- fix-floating-point-epsilon-in-tests-i586.patch lib2geom-1.1.tar.gz New: ---- lib2geom-1.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lib2geom.spec ++++++ --- /var/tmp/diff_new_pack.VVFmii/_old 2023-01-07 17:16:23.320965526 +0100 +++ /var/tmp/diff_new_pack.VVFmii/_new 2023-01-07 17:16:23.328965574 +0100 @@ -17,20 +17,19 @@ %define __builder ninja -%define sonum 1_1_0 +%define sonum 1_2_0 +%define sover 1.2.0 %define libname lib2geom%{sonum} %define develname 2geom -%define short_version 1.1 +%define short_version 1.2.2 Name: lib2geom -Version: 1.1.0 +Version: 1.2.2 Release: 0 Summary: Easy to use 2D geometry library in C++ License: LGPL-2.1-only AND MPL-1.1 URL: https://gitlab.com/inkscape/%{name} Group: System/Libraries Source0: %{url}/-/archive/%{short_version}/%{name}-%{short_version}.tar.gz -# PATCH-FIX-UPSTREAM -Patch0: fix-floating-point-epsilon-in-tests-i586.patch # PATCH-FIX-OPENSUSE Patch1: fix-pkgconfig-libdir-path.patch BuildRequires: libboost_headers-devel @@ -91,7 +90,7 @@ %files -n %{libname} %license COPYING-LGPL-2.1 COPYING-MPL-1.1 %doc NEWS.md README.md -%{_libdir}/%{name}.so.%{version} +%{_libdir}/%{name}.so.%{sover} %files devel %dir %{_includedir}/%{develname}-%{version}/ ++++++ fix-pkgconfig-libdir-path.patch ++++++ --- /var/tmp/diff_new_pack.VVFmii/_old 2023-01-07 17:16:23.368965813 +0100 +++ /var/tmp/diff_new_pack.VVFmii/_new 2023-01-07 17:16:23.372965836 +0100 @@ -1,7 +1,7 @@ -Index: lib2geom-1.1/2geom.pc.in +Index: lib2geom-1.2.2/2geom.pc.in =================================================================== ---- lib2geom-1.1.orig/2geom.pc.in -+++ lib2geom-1.1/2geom.pc.in +--- lib2geom-1.2.2.orig/2geom.pc.in ++++ lib2geom-1.2.2/2geom.pc.in @@ -1,6 +1,6 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} @@ -10,14 +10,4 @@ includedir=${prefix}/include Name: 2geom -Index: lib2geom-1.1/CMakeLists.txt -=================================================================== ---- lib2geom-1.1.orig/CMakeLists.txt -+++ lib2geom-1.1/CMakeLists.txt -@@ -147,4 +147,4 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURC - - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/2geom.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/2geom.pc @ONLY IMMEDIATE ) --install(FILES "${CMAKE_CURRENT_BINARY_DIR}/2geom.pc" DESTINATION lib/pkgconfig) -+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/2geom.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ++++++ lib2geom-1.1.tar.gz -> lib2geom-1.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/AUTHORS.md new/lib2geom-1.2.2/AUTHORS.md --- old/lib2geom-1.1/AUTHORS.md 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/AUTHORS.md 2022-11-13 14:05:21.000000000 +0100 @@ -21,6 +21,7 @@ - Jelle R. Moulder - Alvin Penner - Jan Pulmann + - RafaÅ M. Siejakowski - Michael G. Sloan - Aaron Spike - Michael Wybrow diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/CMakeLists.txt new/lib2geom-1.2.2/CMakeLists.txt --- old/lib2geom-1.1/CMakeLists.txt 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/CMakeLists.txt 2022-11-13 14:05:21.000000000 +0100 @@ -3,8 +3,8 @@ set(2GEOM_MAJOR_VERSION 1) -set(2GEOM_MINOR_VERSION 1) -set(2GEOM_PATCH_VERSION 0) +set(2GEOM_MINOR_VERSION 2) +set(2GEOM_PATCH_VERSION 2) set(2GEOM_VERSION ${2GEOM_MAJOR_VERSION}.${2GEOM_MINOR_VERSION}.${2GEOM_PATCH_VERSION}) set(2GEOM_ABI_VERSION ${2GEOM_MAJOR_VERSION}.${2GEOM_MINOR_VERSION}.0) @@ -147,4 +147,4 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/2geom.pc.in ${CMAKE_CURRENT_BINARY_DIR}/2geom.pc @ONLY IMMEDIATE ) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/2geom.pc" DESTINATION lib/pkgconfig) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/2geom.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/NEWS.md new/lib2geom-1.2.2/NEWS.md --- old/lib2geom-1.1/NEWS.md 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/NEWS.md 2022-11-13 14:05:21.000000000 +0100 @@ -1,3 +1,14 @@ +lib2geom v1.2.2 +=============== + +2Geom v1.2.2 is a point release providing minor bugfixes. +Its ABI is compatible with v1.2. + +Changes: + +- Do not raise assertions when intersecting `Geom::EllipticalArc`s. + + lib2geom v1.1.0 =============== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/include/2geom/elliptical-arc.h new/lib2geom-1.2.2/include/2geom/elliptical-arc.h --- old/lib2geom-1.1/include/2geom/elliptical-arc.h 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/include/2geom/elliptical-arc.h 2022-11-13 14:05:21.000000000 +0100 @@ -306,7 +306,8 @@ private: void _updateCenterAndAngles(); - void _filterIntersections(std::vector<ShapeIntersection> &xs, bool is_first) const; + std::vector<ShapeIntersection> _filterIntersections(std::vector<ShapeIntersection> &&xs, bool is_first) const; + bool _validateIntersection(ShapeIntersection &xing, bool is_first) const; Point _initial_point, _final_point; Ellipse _ellipse; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/include/2geom/path.h new/lib2geom-1.2.2/include/2geom/path.h --- old/lib2geom-1.1/include/2geom/path.h 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/include/2geom/path.h 2022-11-13 14:05:21.000000000 +0100 @@ -40,6 +40,7 @@ #include <iostream> #include <memory> #include <optional> +#include <utility> #include <boost/operators.hpp> #include <boost/ptr_container/ptr_vector.hpp> #include <2geom/intersection.h> @@ -738,60 +739,10 @@ * It is important to note that the coordinates passed to appendNew should be finite! * If one of the coordinates is infinite, 2geom will throw a ContinuityError exception. */ - template <typename CurveType, typename A> - void appendNew(A a) { + template <typename CurveType, typename... Args> + void appendNew(Args&&... args) { _unshare(); - do_append(new CurveType(finalPoint(), a)); - } - - template <typename CurveType, typename A, typename B> - void appendNew(A a, B b) { - _unshare(); - do_append(new CurveType(finalPoint(), a, b)); - } - - template <typename CurveType, typename A, typename B, typename C> - void appendNew(A a, B b, C c) { - _unshare(); - do_append(new CurveType(finalPoint(), a, b, c)); - } - - template <typename CurveType, typename A, typename B, typename C, typename D> - void appendNew(A a, B b, C c, D d) { - _unshare(); - do_append(new CurveType(finalPoint(), a, b, c, d)); - } - - template <typename CurveType, typename A, typename B, typename C, typename D, typename E> - void appendNew(A a, B b, C c, D d, E e) { - _unshare(); - do_append(new CurveType(finalPoint(), a, b, c, d, e)); - } - - template <typename CurveType, typename A, typename B, typename C, typename D, typename E, typename F> - void appendNew(A a, B b, C c, D d, E e, F f) { - _unshare(); - do_append(new CurveType(finalPoint(), a, b, c, d, e, f)); - } - - template <typename CurveType, typename A, typename B, typename C, typename D, typename E, typename F, typename G> - void appendNew(A a, B b, C c, D d, E e, F f, G g) { - _unshare(); - do_append(new CurveType(finalPoint(), a, b, c, d, e, f, g)); - } - - template <typename CurveType, typename A, typename B, typename C, typename D, typename E, typename F, typename G, - typename H> - void appendNew(A a, B b, C c, D d, E e, F f, G g, H h) { - _unshare(); - do_append(new CurveType(finalPoint(), a, b, c, d, e, f, g, h)); - } - - template <typename CurveType, typename A, typename B, typename C, typename D, typename E, typename F, typename G, - typename H, typename I> - void appendNew(A a, B b, C c, D d, E e, F f, G g, H h, I i) { - _unshare(); - do_append(new CurveType(finalPoint(), a, b, c, d, e, f, g, h, i)); + do_append(new CurveType(finalPoint(), std::forward<Args>(args)...)); } /** @brief Reduce the closing segment to a point if it's shorter than precision. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/include/2geom/utils.h new/lib2geom-1.2.2/include/2geom/utils.h --- old/lib2geom-1.1/include/2geom/utils.h 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/include/2geom/utils.h 2022-11-13 14:05:21.000000000 +0100 @@ -39,6 +39,12 @@ namespace Geom { +// Throw these errors instead of aserting so code can handle them if needed. +using ErrorCode = int; +enum Errors : ErrorCode { + GEOM_ERR_INTERSECGRAPH, +}; + // proper logical xor inline bool logical_xor (bool a, bool b) { return (a || b) && !(a && b); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/src/2geom/ellipse.cpp new/lib2geom-1.2.2/src/2geom/ellipse.cpp --- old/lib2geom-1.1/src/2geom/ellipse.cpp 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/src/2geom/ellipse.cpp 2022-11-13 14:05:21.000000000 +0100 @@ -305,8 +305,8 @@ _angle = atan2(v); return *this; } else if (mwot.isScale(0) && _angle.radians() == 0) { - _rays[X] = _rays[X] * mwot[0]; - _rays[Y] = _rays[Y] * mwot[3]; + _rays[X] *= std::abs(mwot[0]); + _rays[Y] *= std::abs(mwot[3]); _center = new_center; return *this; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/src/2geom/elliptical-arc.cpp new/lib2geom-1.2.2/src/2geom/elliptical-arc.cpp --- old/lib2geom-1.1/src/2geom/elliptical-arc.cpp 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/src/2geom/elliptical-arc.cpp 2022-11-13 14:05:21.000000000 +0100 @@ -563,24 +563,49 @@ } #endif - -void EllipticalArc::_filterIntersections(std::vector<ShapeIntersection> &xs, bool is_first) const +/** @brief Convert the passed intersections to curve time parametrization + * and filter out any invalid intersections. + */ +std::vector<ShapeIntersection> EllipticalArc::_filterIntersections(std::vector<ShapeIntersection> &&xs, + bool is_first) const { - Interval unit(0, 1); - std::vector<ShapeIntersection>::reverse_iterator i = xs.rbegin(), last = xs.rend(); - while (i != last) { - Coord &t = is_first ? i->first : i->second; - constexpr auto eps = 1e-4; - assert(are_near_rel(_ellipse.pointAt(t), i->point(), eps)); - t = timeAtAngle(t); - if (!unit.contains(t)) { - xs.erase((++i).base()); - continue; - } else { - assert(are_near_rel(pointAt(t), i->point(), eps)); - ++i; + std::vector<ShapeIntersection> result; + result.reserve(xs.size()); + for (auto &xing : xs) { + if (_validateIntersection(xing, is_first)) { + result.emplace_back(std::move(xing)); } } + return result; +} + +/** @brief Convert the passed intersection to curve time and check whether the intersection + * is numerically sane. + * + * @param xing The intersection to convert to curve time and to validate. + * @param is_first If true, this arc is the first of the intersected curves; if false, it's second. + * @return Whether the intersection is valid. + * + * Note that the intersection is guaranteed to be converted only if the return value is true. + */ +bool EllipticalArc::_validateIntersection(ShapeIntersection &xing, bool is_first) const +{ + static auto const UNIT_INTERVAL = Interval(0, 1); + constexpr auto EPS = 1e-4; + + Coord &t = is_first ? xing.first : xing.second; + if (!are_near_rel(_ellipse.pointAt(t), xing.point(), EPS)) { + return false; + } + + t = timeAtAngle(t); + if (!UNIT_INTERVAL.contains(t)) { + return false; + } + if (!are_near_rel(pointAt(t), xing.point(), EPS)) { + return false; + } + return true; } std::vector<CurveIntersection> EllipticalArc::intersect(Curve const &other, Coord eps) const @@ -590,32 +615,22 @@ return ls.intersect(other, eps); } - std::vector<CurveIntersection> result; - if (other.isLineSegment()) { LineSegment ls(other.initialPoint(), other.finalPoint()); - result = _ellipse.intersect(ls); - _filterIntersections(result, true); - return result; - } - - BezierCurve const *bez = dynamic_cast<BezierCurve const *>(&other); - if (bez) { - result = _ellipse.intersect(bez->fragment()); - _filterIntersections(result, true); - return result; - } - - EllipticalArc const *arc = dynamic_cast<EllipticalArc const *>(&other); - if (arc) { - result = _ellipse.intersect(arc->_ellipse); - _filterIntersections(result, true); - arc->_filterIntersections(result, false); - return result; + return _filterIntersections(_ellipse.intersect(ls), true); + } + + if (auto bez = dynamic_cast<BezierCurve const *>(&other)) { + return _filterIntersections(_ellipse.intersect(bez->fragment()), true); + } + + if (auto arc = dynamic_cast<EllipticalArc const *>(&other)) { + auto result = _filterIntersections(_ellipse.intersect(arc->_ellipse), true); + return arc->_filterIntersections(std::move(result), false); } // in case someone wants to make a custom curve type - result = other.intersect(*this, eps); + auto result = other.intersect(*this, eps); transpose_in_place(result); return result; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/src/2geom/intersection-graph.cpp new/lib2geom-1.2.2/src/2geom/intersection-graph.cpp --- old/lib2geom-1.1/src/2geom/intersection-graph.cpp 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/src/2geom/intersection-graph.cpp 2022-11-13 14:05:21.000000000 +0100 @@ -361,7 +361,7 @@ result.push_back(Path(i->p)); result.back().setStitching(true); - + bool reverse = false; while (i->_proc_hook.is_linked()) { ILIter prev = i; std::size_t pi = i->pos.path_index; @@ -370,7 +370,7 @@ // intersection: always go inside // a minus b: go inside in b, outside in a // b minus a: go inside in a, outside in b - bool reverse = false; + reverse = false; if (w == 0) { reverse = (i->next_edge == INSIDE) ^ enter_a; } else { @@ -407,14 +407,19 @@ w = i->which; } result.back().close(true); - - assert(!result.back().empty()); + if (reverse){ + result.back() = result.back().reversed(); + } + if (result.back().empty()) { + // std::cerr << "Path is empty" << std::endl; + throw GEOM_ERR_INTERSECGRAPH; + } + } + + if (n_processed != size() * 2) { + // std::cerr << "Processed " << n_processed << " intersections, expected " << (size() * 2) << std::endl; + throw GEOM_ERR_INTERSECGRAPH; } - - /*if (n_processed != size() * 2) { - std::cerr << "Processed " << n_processed << " intersections, expected " << (size() * 2) << std::endl; - }*/ - assert(n_processed == size() * 2); return result; } @@ -491,3 +496,4 @@ End: */ // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/src/2geom/path-intersection.cpp new/lib2geom-1.2.2/src/2geom/path-intersection.cpp --- old/lib2geom-1.1/src/2geom/path-intersection.cpp 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/src/2geom/path-intersection.cpp 2022-11-13 14:05:21.000000000 +0100 @@ -411,13 +411,11 @@ std::vector<double> ret; if(p.empty()) return ret; - bool pdx=2, pdy=2; //Previous derivative direction + int pdx = 2, pdy = 2; // Previous derivative direction for(unsigned i = 0; i < p.size(); i++) { std::vector<double> spl = offset_doubles(curve_mono_splits(p[i]), i); - bool dx = p[i].initialPoint()[X] > (spl.empty()? p[i].finalPoint()[X] : - p.valueAt(spl.front(), X)); - bool dy = p[i].initialPoint()[Y] > (spl.empty()? p[i].finalPoint()[Y] : - p.valueAt(spl.front(), Y)); + int dx = p[i].initialPoint()[X] > (spl.empty() ? p[i].finalPoint()[X] : p.valueAt(spl.front(), X)) ? 1 : 0; + int dy = p[i].initialPoint()[Y] > (spl.empty() ? p[i].finalPoint()[Y] : p.valueAt(spl.front(), Y)) ? 1 : 0; //The direction changed, include the split time if(dx != pdx || dy != pdy) { ret.push_back(i); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/src/2geom/sbasis-to-bezier.cpp new/lib2geom-1.2.2/src/2geom/sbasis-to-bezier.cpp --- old/lib2geom-1.1/src/2geom/sbasis-to-bezier.cpp 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/src/2geom/sbasis-to-bezier.cpp 2022-11-13 14:05:21.000000000 +0100 @@ -240,8 +240,8 @@ midx = 8*midx - 4*bz[0][X] - 4*bz[3][X]; // re-define relative to center midy = 8*midy - 4*bz[0][Y] - 4*bz[3][Y]; - midx_0 = sb[X][1][0] + sb[X][1][1]; // zeroth order estimate - midy_0 = sb[Y][1][0] + sb[Y][1][1]; + midx_0 = sb[X].size() > 1 ? sb[X][1][0] + sb[X][1][1] : 0; // zeroth order estimate + midy_0 = sb[Y].size() > 1 ? sb[Y][1][0] + sb[Y][1][1] : 0; if ((std::abs(xprime[0]) < EPSILON) && (std::abs(yprime[0]) < EPSILON) && ((std::abs(xprime[1]) > EPSILON) || (std::abs(yprime[1]) > EPSILON))) { // degenerate handle at 0 : use distance of closest approach Binary files old/lib2geom-1.1/src/toys/data/.parser.cpp.swp and new/lib2geom-1.2.2/src/toys/data/.parser.cpp.swp differ Binary files old/lib2geom-1.1/src/toys/data/parser and new/lib2geom-1.2.2/src/toys/data/parser differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/tests/bezier-test.cpp new/lib2geom-1.2.2/tests/bezier-test.cpp --- old/lib2geom-1.1/tests/bezier-test.cpp 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/tests/bezier-test.cpp 2022-11-13 14:05:21.000000000 +0100 @@ -134,12 +134,13 @@ unsigned N = wiggle.order() + 1; std::vector<Coord> left(N), right(N); std::vector<Coord> left2(N), right2(N); + double eps = 1e-15; for (unsigned i = 0; i < 10000; ++i) { double t = g_random_double_range(0, 1); double vok = bernstein_value_at(t, &wiggle[0], wiggle.order()); double v = casteljau_subdivision<double>(t, &wiggle[0], &left[0], &right[0], wiggle.order()); - EXPECT_EQ(v, vok); + EXPECT_near(v, vok, eps); EXPECT_EQ(left[0], wiggle.at0()); EXPECT_EQ(left[wiggle.order()], right[0]); EXPECT_EQ(right[wiggle.order()], wiggle.at1()); @@ -147,8 +148,8 @@ double vl = casteljau_subdivision<double>(t, &wiggle[0], &left2[0], NULL, wiggle.order()); double vr = casteljau_subdivision<double>(t, &wiggle[0], NULL, &right2[0], wiggle.order()); EXPECT_EQ(vl, vok); - EXPECT_EQ(vr, vok); - EXPECT_vector_equal(left2, left); + EXPECT_near(vr, vok, eps); + EXPECT_vector_near(left2, left, eps); EXPECT_vector_equal(right2, right); double vnone = casteljau_subdivision<double>(t, &wiggle[0], NULL, NULL, wiggle.order()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/tests/interval-test.cpp new/lib2geom-1.2.2/tests/interval-test.cpp --- old/lib2geom-1.1/tests/interval-test.cpp 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/tests/interval-test.cpp 2022-11-13 14:05:21.000000000 +0100 @@ -6,7 +6,7 @@ * * Copyright 2021 Authors * - * SPDX-License-Identifier: LGPL-2.1-or-later OR MPL-1.1 + * SPDX-License-Identifier: LGPL-2.1 OR MPL-1.1 */ #include <2geom/interval.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib2geom-1.1/tests/sbasis-test.cpp new/lib2geom-1.2.2/tests/sbasis-test.cpp --- old/lib2geom-1.1/tests/sbasis-test.cpp 2021-01-15 18:42:28.000000000 +0100 +++ new/lib2geom-1.2.2/tests/sbasis-test.cpp 2022-11-13 14:05:21.000000000 +0100 @@ -221,6 +221,19 @@ } } +TEST_F(SBasisTest, ToCubicBezier) +{ + vector<double> params = { 0, 1, -2, 3 }; + + D2<SBasis> sb(wiggle, wiggle); + vector<Point> bz; + sbasis_to_cubic_bezier(bz, sb); + for (int i = 0; i < params.size(); i++) { + EXPECT_FLOAT_EQ(bz[i][0], params[i]); + EXPECT_FLOAT_EQ(bz[i][1], params[i]); + } +} + /* Local Variables: mode:c++