summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Herlant <herlantj@gmail.com>2018-09-09 23:47:36 -0700
committerJoseph Herlant <herlantj@gmail.com>2018-09-10 00:59:30 -0700
commit0b8f91adb022d4baf6d6a7ae74e7edc48fdd214a (patch)
tree49a99d7d384c22e6bdbc6ccc919141d8663ce056
parentbb2f0fa8904f1dcd0b487b91ce82ea12a4c8b6d5 (diff)
Allow rounding without having to allow a random number of errors in tests/volume-test.c (Closes: #906504)
-rw-r--r--debian/patches/volume-test.patch36
1 files changed, 28 insertions, 8 deletions
diff --git a/debian/patches/volume-test.patch b/debian/patches/volume-test.patch
index f7e40b7..0988157 100644
--- a/debian/patches/volume-test.patch
+++ b/debian/patches/volume-test.patch
@@ -1,19 +1,39 @@
-Description: Increase the acceptable rounding error threshold for volume-test.c
+Description: Allow rounding without having to allow a random number of errors
+ in tests/volume-test.c
Bug: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/559
-Origin: upstream, https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/4
+Origin: upstream, https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/7
Bug-Debian: https://bugs.debian.org/906504
-Last-update: 2018-09-05
+Last-update: 2018-09-09
Reviewed-by: Joseph Herlant <herlantj@gmail.com>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/tests/volume-test.c
+++ b/src/tests/volume-test.c
-@@ -145,7 +145,7 @@
- * hardware. The original limit was 251 errors, but it was increased to 253
- * when the test was failing on Tanu's laptop.
- * See https://bugs.freedesktop.org/show_bug.cgi?id=72374 */
+@@ -131,7 +131,11 @@
+ if (p1 < p && p - p1 > md)
+ md = p - p1;
+
+- if (p1 != p || p2 != p)
++ /* As the hardware, the compiler version and the compilation flags
++ * may sometimes generate rounding errors, we allow p1 and p2 to have
++ * a difference of + or - 1. Note that those are uint32_t, so unsigned.
++ */
++ if ((p > 0 && p1 < p-1) || p1 > p+1 || (p > 0 && p2 < p-1) || p2 > p+1)
+ mdn++;
+ }
+ }
+@@ -139,13 +143,7 @@
+ pa_log("max deviation: %lu n=%lu", (unsigned long) md, (unsigned long) mdn);
+
+ fail_unless(md <= 1);
+-
+- /* mdn counts the times there were rounding errors during the test. The
+- * number of rounding errors seems to vary slightly depending on the
+- * hardware. The original limit was 251 errors, but it was increased to 253
+- * when the test was failing on Tanu's laptop.
+- * See https://bugs.freedesktop.org/show_bug.cgi?id=72374 */
- fail_unless(mdn <= 253);
-+ fail_unless(mdn <= 300);
++ fail_unless(mdn <= 0);
}
END_TEST