From: Erik de Castro Lopo Date: Thu, 25 Apr 2013 03:53:21 +0000 (+1000) Subject: test/test_metaflac.sh: POSIXify embedded awk script. X-Git-Tag: 1.3.0pre4~6 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fflac.git;a=commitdiff_plain;h=69c44a51de295a6eb91ab0fdb1777d222395dab0 test/test_metaflac.sh: POSIXify embedded awk script. The embedded awk script was using the 'lshift' function which apparently only exists in GNU auk (gawk) and definitely does not exist in mawk. Thanks to Martijn van Beurden for reporting this issue. --- diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh index 113e19f..9a13291 100755 --- a/test/test_metaflac.sh +++ b/test/test_metaflac.sh @@ -399,6 +399,7 @@ echo OK tonegenerator () { + # When using GAWK, use --lint=posix to identify non-POSIX awk usages. awk -- ' BEGIN { samplerate = '$1'; @@ -407,7 +408,11 @@ tonegenerator () duration = 1; bitspersample = 24; - samplemidpoint = lshift(1, (bitspersample-1)); + samplemidpoint = 1; + for (sps = 0 ; sps < bitspersample - 1 ; sps++) { + samplemidpoint *= 2; + } + samplerange = samplemidpoint - 1; pi = 4 * atan2(1,1);