Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 175fbd38 authored by Andy Hung's avatar Andy Hung
Browse files

AudioEffect: explicitly show errors in lvmtest

Test: instrumented test
Change-Id: I406c23517ef401540fb497134a42abb1261d9225
parent 76e348fc
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ fs_arr=(

# run multichannel effects at different configs, saving only the stereo channel
# pair.
error_count=0
for flags in "${flags_arr[@]}"
do
    for fs in ${fs_arr[*]}
@@ -65,6 +66,13 @@ do
            adb shell $testdir/lvmtest -i:$testdir/sinesweepraw.raw \
                -o:$testdir/sinesweep_$((ch))_$((fs)).raw -ch:$ch -fs:$fs $flags

            shell_ret=$?
            if [ $shell_ret -ne 0 ]; then
                echo "error: $shell_ret"
                ((++error_count))
            fi


            # two channel files should be identical to higher channel
            # computation (first 2 channels).
            # Do not compare cases where -bE is in flags (due to mono computation)
@@ -78,8 +86,17 @@ do
                    $testdir/sinesweep_$((ch))_$((fs)).raw -thr:90.308998
            fi

            # both cmp and snr return EXIT_FAILURE on mismatch.
            shell_ret=$?
            if [ $shell_ret -ne 0 ]; then
                echo "error: $shell_ret"
                ((++error_count))
            fi

        done
    done
done

adb shell rm -r $testdir
echo "$error_count errors"
exit $error_count
+3 −1
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ int main(int argc, const char *argv[]) {
    printf("\nError: missing input/reference files\n");
    return -1;
  }
  int ret = EXIT_SUCCESS;
  auto sn = pcm_format == 0
      ? getSignalNoise<short>(finp, fref)
      : getSignalNoise<float>(finp, fref);
@@ -92,6 +93,7 @@ int main(int argc, const char *argv[]) {
    // compare the measured snr value with threshold
    if (snr < thr) {
      printf("%.6f less than threshold %.6f\n", snr, thr);
      ret = EXIT_FAILURE;
    } else {
      printf("%.6f\n", snr);
    }
@@ -99,5 +101,5 @@ int main(int argc, const char *argv[]) {
  fclose(finp);
  fclose(fref);

  return 0;
  return ret;
}