eof() public method

public eof ( ) : bool
return bool
Esempio n. 1
0
        public void testEmptyTree_NoTreeWalk()
        {
            DirCache dc = DirCache.read(db);
            Assert.AreEqual(0, dc.getEntryCount());

            var i = new DirCacheIterator(dc);
            Assert.IsTrue(i.eof());
        }
Esempio n. 2
0
        public void testNoSubtree_NoTreeWalk()
        {
            DirCache dc = DirCache.read(db);

            string[] paths = { "a.", "a0b" };
            var ents = new DirCacheEntry[paths.Length];

            for (int i = 0; i < paths.Length; i++)
            {
                ents[i] = new DirCacheEntry(paths[i]);
            }

            DirCacheBuilder b = dc.builder();
            for (int i = 0; i < ents.Length; i++)
            {
                b.add(ents[i]);
            }

            b.finish();

            var iter = new DirCacheIterator(dc);
            int pathIdx = 0;
            for (; !iter.eof(); iter.next(1))
            {
                Assert.AreEqual(pathIdx, iter.Pointer);
                Assert.AreSame(ents[pathIdx], iter.getDirCacheEntry());
                pathIdx++;
            }

            Assert.AreEqual(paths.Length, pathIdx);
        }