public void TestReplace() { var b = new RenderingBlock(); Int3 u = new Int3(1, 2, 3); b.Set(u, Matrix4x4.identity); b.Set(u, Matrix4x4.identity); b.Set(u, Matrix4x4.identity); Assert.AreEqual(1, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); }
public void TestRenderingBlockBasic() { var b = new RenderingBlock(); Int3 u = new Int3(1, 2, 3); Int3 v = new Int3(4, 5, 6); Int3 w = new Int3(0, 0, 0); Assert.AreEqual(0, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Set(u, Matrix4x4.identity); Assert.AreEqual(1, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Clear(v); Assert.AreEqual(1, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Clear(u); Assert.AreEqual(0, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Set(u, Matrix4x4.identity); Assert.AreEqual(1, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Set(v, Matrix4x4.identity); Assert.AreEqual(2, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Clear(w); Assert.AreEqual(2, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Clear(u); Assert.AreEqual(1, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Set(w, Matrix4x4.identity); Assert.AreEqual(2, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Clear(v); Assert.AreEqual(1, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Clear(u); Assert.AreEqual(1, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); b.Clear(w); Assert.AreEqual(0, b.GetNumOccupied()); Assert.IsTrue(b.CheckInvariants()); }