1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 02:11:06 +09:00
Files
lidgren-network-gen3/UnitTests/BitVectorTests.cs

36 lines
672 B
C#

using System;
using Lidgren.Network;
namespace UnitTests
{
public static class BitVectorTests
{
public static void Run()
{
NetBitVector v = new NetBitVector(256);
for (int i = 0; i < 256; i++)
{
v.Clear();
if (!v.IsEmpty())
throw new NetException("bit vector fail 1");
v.Set(i, true);
if (v.Get(i) == false)
throw new NetException("bit vector fail 2");
if (v.IsEmpty())
throw new NetException("bit vector fail 3");
int f = v.GetFirstSetIndex();
if (f != i)
throw new NetException("bit vector fail 4");
}
Console.WriteLine("NetBitVector tests OK");
}
}
}