public void FixBVTest() { var bv = new FixedSizeBitVector(32); bv.Set(1); bv.Set(9); var b = bv.FindNextOne(-1); Assert.AreEqual<int>(1, b); b = bv.FindNextOne(b); Assert.AreEqual<int>(9, b); b = bv.FindNextOne(b); Assert.AreEqual<int>(-1, b); }
public void FixBVTest() { var bv = new FixedSizeBitVector(32); bv.Set(1); bv.Set(9); var b = bv.FindNextOne(-1); Assert.AreEqual <int>(1, b); b = bv.FindNextOne(b); Assert.AreEqual <int>(9, b); b = bv.FindNextOne(b); Assert.AreEqual <int>(-1, b); }
private int AddFdList(Thread current, FixedSizeBitVector fdlist, short event_type) { var proc = current.Parent; for (int fd = fdlist.FindNextOne(-1); fd > 0; fd = fdlist.FindNextOne(fd)) { //Arch.Console.Write("AddFdList:"); //Arch.Console.Write(fd); //Arch.Console.Write(" ev-"); //Arch.Console.Write(event_type); //Arch.Console.WriteLine(); var file = proc.LookupFile(fd); if (file == null) return -ErrorCode.EBADF; if (file.inode.LinuxFd < 0) return -ErrorCode.EINVAL; Add(file.inode.LinuxFd, fd, event_type); } return 0; }