public void Test() { Assert.AreEqual(Globals.MemoryPool.AllocatedBytes, 0L); DiskIo stream = DiskIo.CreateMemoryFile(Globals.MemoryPool, BlockSize); TestReadAndWrites(stream); TestReadAndWritesWithCommit(stream); TestReadAndWritesToDifferentFilesWithCommit(stream); TestBinaryStream(stream); stream.Dispose(); Assert.IsTrue(true); Assert.AreEqual(Globals.MemoryPool.AllocatedBytes, 0L); }
public void Test() { int blockSize = 4096; Assert.AreEqual(Globals.MemoryPool.AllocatedBytes, 0L); DiskIo stream = DiskIo.CreateMemoryFile(Globals.MemoryPool, blockSize); SubFileName name = SubFileName.CreateRandom(); SubFileHeader node = new SubFileHeader(1, name, false, false); SubFileDiskIoSessionPool pool = new SubFileDiskIoSessionPool(stream, stream.LastCommittedHeader, node, true); IndexParser parse = new IndexParser(pool); parse.SetPositionAndLookup(14312); pool.Dispose(); Assert.IsTrue(true); Assert.AreEqual(Globals.MemoryPool.AllocatedBytes, 0L); }
public void Test() { Assert.AreEqual(Globals.MemoryPool.AllocatedBytes, 0L); DiskIo stream = DiskIo.CreateMemoryFile(Globals.MemoryPool, BlockSize); FileHeaderBlock fat = stream.LastCommittedHeader; //obtain a readonly copy of the file allocation table. fat = stream.LastCommittedHeader; TestCreateNewFile(stream, fat); fat = stream.LastCommittedHeader; TestOpenExistingFile(stream, fat); fat = stream.LastCommittedHeader; TestRollback(stream, fat); fat = stream.LastCommittedHeader; TestVerifyRollback(stream, fat); Assert.IsTrue(true); stream.Dispose(); Assert.AreEqual(Globals.MemoryPool.AllocatedBytes, 0L); }
/// <summary> /// Creates a new archive file that is completely in memory /// </summary> public static TransactionalFileStructure CreateInMemory(int blockSize, params Guid[] flags) { DiskIo disk = DiskIo.CreateMemoryFile(Globals.MemoryPool, blockSize, flags); return(new TransactionalFileStructure(disk)); }