From 50448e11308c455f0ff504ecbb92e730c7ca2bdb Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 26 Oct 2010 15:20:19 +0100 Subject: [PATCH] volume: Make tests use only valid volumes --- src/pulsecore/svolume_arm.c | 2 +- src/pulsecore/svolume_mmx.c | 2 +- src/pulsecore/svolume_sse.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c index c2830cf..12660dd 100644 --- a/src/pulsecore/svolume_arm.c +++ b/src/pulsecore/svolume_arm.c @@ -152,7 +152,7 @@ static void run_test (void) { memcpy (samples_orig, samples, sizeof (samples)); for (i = 0; i < CHANNELS; i++) - volumes[i] = rand() >> 1; + volumes[i] = PA_CLAMP_VOLUME(rand() >> 1); for (padding = 0; padding < PADDING; padding++, i++) volumes[i] = volumes[padding]; diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c index 3e2992a..5bfe6d4 100644 --- a/src/pulsecore/svolume_mmx.c +++ b/src/pulsecore/svolume_mmx.c @@ -267,7 +267,7 @@ static void run_test (void) { memcpy (samples_orig, samples, sizeof (samples)); for (i = 0; i < CHANNELS; i++) - volumes[i] = rand() >> 1; + volumes[i] = PA_CLAMP_VOLUME(rand() >> 1); /* volumes[i] = 0x0000ffff; */ for (padding = 0; padding < PADDING; padding++, i++) volumes[i] = volumes[padding]; diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c index 200482e..f3aa1ed 100644 --- a/src/pulsecore/svolume_sse.c +++ b/src/pulsecore/svolume_sse.c @@ -277,7 +277,7 @@ static void run_test (void) { memcpy (samples_orig, samples, sizeof (samples)); for (i = 0; i < CHANNELS; i++) - volumes[i] = rand() >> 1; + volumes[i] = PA_CLAMP_VOLUME(rand() >> 1); for (padding = 0; padding < PADDING; padding++, i++) volumes[i] = volumes[padding]; -- 2.7.4