Mercurial > hg > svcore
diff base/test/TestColumnOp.h @ 1267:1d8418cca63a 3.0-integration
Further column op tests and fixes
author | Chris Cannam |
---|---|
date | Thu, 17 Nov 2016 14:46:03 +0000 |
parents | dd190086db73 |
children | f50c0bbe9096 |
line wrap: on
line diff
--- a/base/test/TestColumnOp.h Thu Nov 17 14:33:20 2016 +0000 +++ b/base/test/TestColumnOp.h Thu Nov 17 14:46:03 2016 +0000 @@ -195,7 +195,14 @@ void distribute_simple_interpolated() { Column in { 1, 2, 3 }; BinMapping binfory { 0.0, 0.5, 1.0, 1.5, 2.0, 2.5 }; - Column expected { 1, 1.5, 2, 2.5, 3, 3 }; + // There is a 0.5-bin offset from the distribution you might + // expect, because this corresponds visually to the way that + // bin values are duplicated upwards in simple_distribution. + // It means that switching between interpolated and + // non-interpolated views retains the visual position of each + // bin peak as somewhere in the middle of the scale area for + // that bin. + Column expected { 1, 1, 1.5, 2, 2.5, 3 }; Column actual(C::distribute(in, 6, binfory, 0, true)); report(actual); QCOMPARE(actual, expected); @@ -211,9 +218,10 @@ } void distribute_nonlinear_interpolated() { + // See distribute_simple_interpolated Column in { 1, 2, 3 }; BinMapping binfory { 0.0, 0.2, 0.5, 1.0, 2.0, 2.5 }; - Column expected { 1, 1.2, 1.5, 2, 3, 3 }; + Column expected { 1, 1, 1, 1.5, 2.5, 3 }; Column actual(C::distribute(in, 6, binfory, 0, true)); report(actual); QCOMPARE(actual, expected);