[med-svn] [Git][med-team/bart][master] backport fixes for tests
Martin Uecker (@uecker-guest)
gitlab at salsa.debian.org
Thu Dec 30 06:10:33 GMT 2021
Martin Uecker pushed to branch master at Debian Med / bart
Commits:
092749f1 by Martin Uecker at 2021-12-30T07:04:20+01:00
backport fixes for tests
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/0007-backported-test-fixes.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -9,6 +9,7 @@ bart (0.7.00-1) UNRELEASED; urgency=medium
* Deterministic build.
* Run test suite.
* Don't update commands.txt.
+ * Backport fixes for tests.
[ Andreas Tille ]
* Standards-Version: 4.6.0 (routine-update)
=====================================
debian/patches/0007-backported-test-fixes.patch
=====================================
@@ -0,0 +1,85 @@
+From: Martin Uecker <uecker at tugraz.at>
+Date: Sat, 18 Dec 2021 19:45:51 +0100
+Subject: backported test fixes
+
+---
+ src/num/splines.c | 2 +-
+ src/num/vec3.c | 5 +++--
+ src/simu/biot_savart.c | 3 +--
+ utests/test_biot_savart.c | 6 +++---
+ 4 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/num/splines.c b/src/num/splines.c
+index 289a055..f710937 100644
+--- a/src/num/splines.c
++++ b/src/num/splines.c
+@@ -316,7 +316,7 @@ void bspline_coeff_derivative_n(unsigned int k, unsigned int n, unsigned int p,
+ double v1[n - p - 1];
+
+ bspline_coeff_derivative(n, p, t1, v1, t, v);
+- bspline_coeff_derivative_n(k - 1, n - 1, p - 1, t2, v2, t1, v1);
++ bspline_coeff_derivative_n(k - 1, n - 2, p - 1, t2, v2, t1, v1);
+ }
+ }
+
+diff --git a/src/num/vec3.c b/src/num/vec3.c
+index b75ebbe..72d872f 100644
+--- a/src/num/vec3.c
++++ b/src/num/vec3.c
+@@ -30,12 +30,13 @@ void vec3_add(vec3_t dst, const vec3_t src1, const vec3_t src2)
+
+ void vec3_copy(vec3_t dst, const vec3_t src)
+ {
+- vec3_saxpy(dst, src, 0., src);
++ for (int i = 0; i < 3; i++)
++ dst[i] = src[i];
+ }
+
+ void vec3_clear(vec3_t dst)
+ {
+- vec3_saxpy(dst, dst, -1., dst);
++ vec3_copy(dst, (vec3_t){ 0. });
+ }
+
+ float vec3_sdot(const vec3_t a, const vec3_t b)
+diff --git a/src/simu/biot_savart.c b/src/simu/biot_savart.c
+index 446ff84..2e7ee73 100644
+--- a/src/simu/biot_savart.c
++++ b/src/simu/biot_savart.c
+@@ -39,8 +39,7 @@ void biot_savart(vec3_t b, const vec3_t r, unsigned int N, const vec3_t curve[st
+
+ vec3_t x;
+ vec3_rot(x, l, d);
+- vec3_smul(x, x, c / pow(n, 3.)); //saxpy
+- vec3_add(b, b, x);
++ vec3_saxpy(b, b, c / pow(n, 3.), x);
+ }
+ }
+
+diff --git a/utests/test_biot_savart.c b/utests/test_biot_savart.c
+index 85aeb93..4017ecf 100644
+--- a/utests/test_biot_savart.c
++++ b/utests/test_biot_savart.c
+@@ -32,7 +32,7 @@ static bool test_vec3_ring(void)
+ ok &= (1.E-6 > fabs(0.33 - vec3_norm(r[i])));
+
+ for (unsigned int i = 0; i < N; i++)
+- ok &= (0. == vec3_sdot(r[i], n));
++ ok &= (1.E-9 > fabsf(vec3_sdot(r[i], n)));
+
+ return ok;
+ }
+@@ -46,11 +46,11 @@ static bool test_biot_savart(void)
+ vec3_t n = { 1., 0., 0. };
+ vec3_ring(N, r, c, n, 0.5);
+ vec3_t x;
+- biot_savart(x, c, N, (const vec3_t*)r);
++ biot_savart(x, c, N, r);
+
+ vec3_t d;
+ vec3_sub(d, x, n);
+- return (1.E-3 > vec3_norm(d));
++ return (1.E-3 > vec3_norm(d));
+ }
+
+
=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@
0004-relax-failing-unit-test.patch
0005-workaround-for-compiler-bug.patch
0006-do-not-update-doc-commands.txt-automatically.patch
+0007-backported-test-fixes.patch
View it on GitLab: https://salsa.debian.org/med-team/bart/-/commit/092749f1fd32c2d21a0116ac0a59cd4e6834efa4
--
View it on GitLab: https://salsa.debian.org/med-team/bart/-/commit/092749f1fd32c2d21a0116ac0a59cd4e6834efa4
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20211230/b9063dd9/attachment-0001.htm>
More information about the debian-med-commit
mailing list