半径ちょうどの距離のセルを含める試験を追加する

このコミットが含まれているのは:
routersys committed 2026-10-21 21:24:51 +09:00
1 親 49a32453a5
コミット 16a50485ab
1ファイル変更
+13
+13
ファイルの表示
@@ -35,6 +35,19 @@ public sealed class ThicknessDilationTests
Assert.Equal(Masks.ToBytes(expected, plan.GridWidth, plan.GridHeight), actual);
}
[Fact]
public void ACellExactlyAtTheRadiusIsInsideLikeTheDiscDilation()
{
var plan = Plan(24.0, 0.0) with { Cell = 8, Radius = 32.0, RadiusSquaredCells = 16 };
var mask = Masks.Random(plan.GridWidth, plan.GridHeight, 7, 1);
var expected = new ulong[BitGrid.WordsPerRow(plan.GridWidth) * plan.GridHeight];
new DiscDilation().Dilate(Masks.ToBits(mask, plan.GridWidth, plan.GridHeight), plan.GridWidth, plan.GridHeight, plan.RadiusSquaredCells, expected);
var actual = Dilate(mask, plan);
Assert.Equal(Masks.ToBytes(expected, plan.GridWidth, plan.GridHeight), actual);
}
[Fact]
public void EveryCellWithinTheMinimumRadiusIsInsideAndEveryCellBeyondTheMaximumIsOutside()
{