summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2014-11-09 17:33:00 +0100
committerPeter Meerwald <p.meerwald@bct-electronic.com>2014-11-17 13:25:04 +0100
commit09a3d904a1f5f1dd05877cc491bb1123edf9e209 (patch)
tree3a1af51a277374399e966f2449ecff53f2305bfd /src/tests
parent68cc36140ba2b48dd3d8fe80b7e25d149536af54 (diff)
tests: Use pa_assert_se() to get rid of an used variable warning
when compiled with NDEBUG Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/lo-test-util.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tests/lo-test-util.c b/src/tests/lo-test-util.c
index 01eb295d7..84e8af3c7 100644
--- a/src/tests/lo-test-util.c
+++ b/src/tests/lo-test-util.c
@@ -72,7 +72,7 @@ static int cal_state = CALIBRATION_ONE;
static void calibrate_write_cb(pa_stream *s, size_t nbytes, void *userdata) {
pa_lo_test_context *ctx = (pa_lo_test_context *) userdata;
- int i, r, nsamp = nbytes / ctx->fs;
+ int i, nsamp = nbytes / ctx->fs;
float tmp[nsamp][2];
static int count = 0;
@@ -80,8 +80,7 @@ static void calibrate_write_cb(pa_stream *s, size_t nbytes, void *userdata) {
for (i = 0; i < nsamp; i++)
tmp[i][0] = tmp[i][1] = cal_state == CALIBRATION_ONE ? sinf(count++ * TONE_HZ * 2 * M_PI / ctx->sample_spec.rate) : 0.0f;
- r = pa_stream_write(s, &tmp, nbytes, nop_free_cb, 0, PA_SEEK_RELATIVE);
- pa_assert(r == 0);
+ pa_assert_se(pa_stream_write(s, &tmp, nbytes, nop_free_cb, 0, PA_SEEK_RELATIVE) == 0);
if (cal_state == CALIBRATION_DONE)
pa_stream_set_write_callback(s, ctx->write_cb, ctx);
@@ -94,12 +93,11 @@ static void calibrate_read_cb(pa_stream *s, size_t nbytes, void *userdata) {
pa_cvolume vol;
pa_operation *o;
- int r, nsamp;
+ int nsamp;
float *in;
size_t l;
- r = pa_stream_peek(s, (const void **)&in, &l);
- pa_assert(r == 0);
+ pa_assert_se(pa_stream_peek(s, (const void **)&in, &l) == 0);
nsamp = l / ctx->fs;