diff options
Diffstat (limited to 'cras/src/dsp/tests/dsp_test_util.c')
-rw-r--r-- | cras/src/dsp/tests/dsp_test_util.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/cras/src/dsp/tests/dsp_test_util.c b/cras/src/dsp/tests/dsp_test_util.c deleted file mode 100644 index e52a481a..00000000 --- a/cras/src/dsp/tests/dsp_test_util.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include <fenv.h> -#include <float.h> -#include <stdio.h> -#include "dsp_test_util.h" - -int dsp_util_has_denormal() -{ - float x = 1; - while (x >= FLT_MIN) - x /= 2; - return x > 0; -} - -void dsp_util_clear_fp_exceptions() -{ - feclearexcept(FE_ALL_EXCEPT); -} - -void dsp_util_print_fp_exceptions() -{ - int excepts = fetestexcept(FE_ALL_EXCEPT); - printf("floating-point exceptions: "); - if (excepts & FE_DIVBYZERO) - printf("FE_DIVBYZERO "); - if (excepts & FE_INVALID) - printf("FE_INVALID "); - if (excepts & FE_OVERFLOW) - printf("FE_OVERFLOW "); - if (excepts & FE_UNDERFLOW) - printf("FE_UNDERFLOW "); - printf("\n"); -} |