예제 #1
0
        public void CopyByAssign()
        {
            BitMask128 mask = m_Mask;

            mask.Set(1);
            Assert.IsFalse(mask.Equals(m_Mask));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        public void PerformaceContains()
        {
            const int passes = 100000000;

            Stopwatch  watch = new Stopwatch();
            BitMask128 maskA = new BitMask128();
            BitMask128 maskB = new BitMask128();

            watch.Restart();
            for (int x = 0; x < passes; ++x)
            {
                maskA.Contains(maskB);
            }
            TestContext.WriteLine($"128bitmask, {passes} passes, time elapsed: {watch.ElapsedMilliseconds}ms");
        }
예제 #5
0
        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");
        }
예제 #6
0
 public void Initialize()
 {
     m_Mask = new BitMask128();
 }