# HG changeset patch # User Chris Cannam # Date 1578653602 0 # Node ID 1b6a9c0484a30ed57d2dce779f4231c4a2d90093 # Parent 935107f64e5fafad3607cffcb4948030d06f3e52 Test export of zoomed 3d plot diff -r 935107f64e5f -r 1b6a9c0484a3 test/layers-expected/selected-zoomed-3dplot.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/layers-expected/selected-zoomed-3dplot.csv Fri Jan 10 10:53:22 2020 +0000 @@ -0,0 +1,6 @@ +0.179846,0.0396893,0.224843,0.195301,0.120157,0.060555,-0.0613906,0.0452138,-0.0833673,0.15962,0.271244,0.226926 +0.181248,0.0513659,0.233262,0.219847,0.142558,0.077017,-0.0347937,0.0605701,-0.0854369,0.160425,0.276,0.231295 +0.195287,0.0767927,0.248401,0.248585,0.163612,0.103101,-0.00696542,0.0658877,-0.100587,0.164787,0.286831,0.23857 +0.306055,0.157791,0.253731,0.338068,0.235329,0.246113,0.0832085,0.0468144,-0.0508195,0.175406,0.314368,0.276219 +0.310497,0.15829,0.270981,0.350949,0.243985,0.262401,0.0922116,0.0389058,-0.0360974,0.183037,0.316748,0.274438 +0.313311,0.158219,0.286231,0.361839,0.251025,0.276719,0.100598,0.0313093,-0.0221492,0.189517,0.3181,0.271809 \ No newline at end of file diff -r 935107f64e5f -r 1b6a9c0484a3 test/test-layer-exports.sh --- a/test/test-layer-exports.sh Thu Jan 09 14:38:40 2020 +0000 +++ b/test/test-layer-exports.sh Fri Jan 10 10:53:22 2020 +0000 @@ -123,6 +123,12 @@ /setcurrent 4 3 /exportlayer "$tmpdir/selected-notes.mid" +# If we also zoom in vertically in the 3d plot, our export should +# include only the zoomed area - check this +/setcurrent 5 2 +/zoomvertical 0 12 +/exportlayer "$tmpdir/selected-zoomed-3dplot.csv" + /quit EOF @@ -152,6 +158,24 @@ done done +for csv in selected-zoomed-3dplot.csv ; do + actual="$tmpdir/$csv" + expected="layers-expected/$csv" + if ! cmp -s "$actual" "$expected" ; then + echo + echo "Test failed for \"$csv\"!" + echo + echo "Actual:" + ls -l "$actual" + echo "Expected:" + ls -l "$expected" + echo + echo "Diff begins:" + diff -u1 "$actual" "$expected" | head + echo + fi +done + for other in notes.mid selected-notes.mid ; do actual="$tmpdir/$other" expected="layers-expected/$other"