summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-11-26 16:20:06 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-11-26 16:29:29 +1100
commitb147b73eabffadc3dd9384b649309913289d451f (patch)
treeb5e768ab97a5fc076862e13f54bd880b0ddc3190 /test
parentff8a74aa70fc8a070d42369fb53ff8eedc51c15f (diff)
downloadflac-b147b73eabffadc3dd9384b649309913289d451f.tar.gz
test/test_compression.sh : Fix for OSX.
On Mac OSX, the 'wc -c' command returns a number with leading whitespace which then results in a syntax error when the shell parser expects a number when it really has a string containing a number. The easy fix is to use string interpolation. Closes: https://sourceforge.net/p/flac/bugs/420/ Reported-by: Mark Harris <mark.hsj@gmail.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_compression.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_compression.sh b/test/test_compression.sh
index 022ff8e2..3d0f5667 100755
--- a/test/test_compression.sh
+++ b/test/test_compression.sh
@@ -36,10 +36,12 @@ for k in 0 1 2 3 4 5 6 7 8 ; do
size=$(wc -c < ${fname})
echo "Compression level ${k}, file size ${size} bytes."
if test ${last_size} -lt ${size} ; then
- echo "Error : Compression ${last_k} size $last_size >= compression $k size $size."
+ echo "Error : Compression ${last_k} size ${last_size} >= compression ${k} size ${size}."
exit 1
fi
- let last_size=${size}+10
+ # Need this string interpolation because OSX's 'wc -c' returns a number with
+ # leading whitespace.
+ let last_size="${size}+10"
last_k=${k}
rm -f ${fname}
done