Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:regataos
lib2geom
fix-floating-point-epsilon-in-tests-i586.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-floating-point-epsilon-in-tests-i586.patch of Package lib2geom
From: Antonio Larrosa <alarrosa@suse.com> Subject: Fix floating point error on i586 by using epsilon Submitted to upstream at https://gitlab.com/inkscape/lib2geom/-/merge_requests/52 Index: lib2geom-1.1/tests/bezier-test.cpp =================================================================== --- lib2geom-1.1.orig/tests/bezier-test.cpp +++ lib2geom-1.1/tests/bezier-test.cpp @@ -134,12 +134,13 @@ TEST_F(BezierTest, Casteljau) { 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 @@ TEST_F(BezierTest, Casteljau) { 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());
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor