Beispiel #1
0
		internal BaseSearch(ProgressMonitor countingMonitor, ICollection<RevTree> bases, 
			ObjectIdOwnerMap<ObjectToPack> objects, IList<ObjectToPack> edges, ObjectReader 
			or)
		{
			progress = countingMonitor;
			reader = or;
			baseTrees = Sharpen.Collections.ToArray(bases, new ObjectId[bases.Count]);
			objectsMap = objects;
			edgeObjects = edges;
			alreadyProcessed = new IntSet();
			treeCache = new ObjectIdOwnerMap<BaseSearch.TreeWithData>();
			parser = new CanonicalTreeParser();
			idBuf = new MutableObjectId();
		}
Beispiel #2
0
		public virtual void TestAdd()
		{
			IntSet s = new IntSet();
			NUnit.Framework.Assert.IsTrue(s.Add(1));
			NUnit.Framework.Assert.IsFalse(s.Add(1));
			for (int i = 2; i < 64; i++)
			{
				NUnit.Framework.Assert.IsTrue(s.Add(i));
			}
			for (int i_1 = 2; i_1 < 64; i_1++)
			{
				NUnit.Framework.Assert.IsFalse(s.Add(i_1));
			}
			NUnit.Framework.Assert.IsTrue(s.Add(-1));
			NUnit.Framework.Assert.IsFalse(s.Add(-1));
			NUnit.Framework.Assert.IsTrue(s.Add(-2));
			NUnit.Framework.Assert.IsFalse(s.Add(-2));
			NUnit.Framework.Assert.IsTrue(s.Add(128));
			NUnit.Framework.Assert.IsFalse(s.Add(128));
			NUnit.Framework.Assert.IsFalse(s.Add(1));
		}