示例#1
0
文件: Tests.cs 项目: ropean/RaptorDB
        public static void WAH_test()
        {
            int count = 500;

            for (int i = 0; i < 1000; i++)
            {
                Console.Write(".");
                if (i % 80 == 0)
                {
                    Console.WriteLine();
                }
                WAHBitArray ba = new WAHBitArray();
                for (int j = 0; j < count; j++)
                {
                    ba.Set(i * count + j, true);
                }

                WAHBitArray.TYPE type;
                var bits = ba.GetCompressed(out type);

                var ba2 = new WAHBitArray(type, bits);

                var  res = ba2.Xor(ba);
                long c   = res.CountOnes();
                Assert.AreEqual(0, c);
            }

            //Random r = new Random();
            //WAHBitArray b = new WAHBitArray();
            //for (int i = 0; i < 100000; i++)
            //{
            //    b.Set(
            //}
        }