public void EqualMask() { m_Mask.Clear(); m_Mask.Set(5); BitMask128 otherMask = new BitMask128(); otherMask.Set(5); Assert.IsTrue(m_Mask.Equals(otherMask)); m_Mask.Set(4); Assert.IsFalse(m_Mask.Equals(otherMask)); }
public void Contains() { m_Mask.Set(2); m_Mask.Set(3); BitMask128 otherMask = new BitMask128(); otherMask.Set(3); Assert.IsTrue(m_Mask.Contains(otherMask)); otherMask.Set(4); Assert.IsFalse(m_Mask.Contains(otherMask)); }
public void CopyByAssign() { BitMask128 mask = m_Mask; mask.Set(1); Assert.IsFalse(mask.Equals(m_Mask)); }
public void PerformaceSet() { const int passes = 1000000; Stopwatch watch = new Stopwatch(); watch.Restart(); for (int x = 0; x < passes; ++x) { BitMask128 mask = new BitMask128(); for (int y = 0; y < BitMask128.LENGTH; ++y) { mask.Set(y); } } TestContext.WriteLine($"128bitmask, {passes} passes, time elapsed: {watch.ElapsedMilliseconds}ms"); }