/// <exception cref="NGit.Errors.MissingObjectException"></exception> /// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception> /// <exception cref="System.IO.IOException"></exception> /// <exception cref="NGit.Errors.LargeObjectException"></exception> private DeltaIndex Index(DeltaWindowEntry ent) { DeltaIndex idx = ent.index; if (idx == null) { try { idx = new DeltaIndex(Buffer(ent)); } catch (OutOfMemoryException noMemory) { LargeObjectException.OutOfMemory e; e = new LargeObjectException.OutOfMemory(noMemory); e.SetObjectId(ent.@object); throw e; } if (0 < maxMemory) { loaded += idx.GetIndexSize() - idx.GetSourceSize(); } ent.index = idx; } return idx; }
public virtual void TestIndexSize() { src = GetRng().NextBytes(1024); DeltaIndex di = new DeltaIndex(src); NUnit.Framework.Assert.AreEqual(1860, di.GetIndexSize()); NUnit.Framework.Assert.AreEqual("DeltaIndex[2 KiB]", di.ToString()); }