# HG changeset patch # User Chris Cannam # Date 1368389574 -3600 # Node ID a8c84f59f7c0f666574afd77ed1806e1029bf356 # Parent ac13730670548e970cc2baff03dc6b84440b1baf Print out the offending channel diff -r ac1373067054 -r a8c84f59f7c0 yetilab/stream/test/test_audiofile.yeti --- a/yetilab/stream/test/test_audiofile.yeti Sun May 12 18:04:48 2013 +0100 +++ b/yetilab/stream/test/test_audiofile.yeti Sun May 12 21:12:54 2013 +0100 @@ -26,12 +26,12 @@ bitdepthComparator depth = (mult = fold do a _: a*2 done 1 [1..depth]; - // We compare at depth-1 rather than depth to avoid rounding problems mult = mult / 2; + roundedBy f x = round (x * f); do a b: - a' = int (a * mult); - b' = int (b * mult); - if a' == b' then true + a' = roundedBy mult a; + b' = roundedBy mult b; + if abs(a' - b') <= 1 then true else eprintln "bitdepthComparator: \(a) != \(b) at bitdepth \(depth) [\(a') != \(b')]"; false; @@ -48,6 +48,15 @@ true else println "** peak difference: \(maxOf (mat.difference ref test))"; + for [0..mat.height test - 1] do ch: + if mat.equalUnder (bitdepthComparator bitdepth) + (mat.newRowVector (mat.getRow ch test)) + (mat.newRowVector (mat.getRow ch ref)) then + println " channel \(ch): ok"; + else + println " channel \(ch): not ok"; + fi; + done; false fi);