public void all_the_entries_have_upgraded_hashes() { if (_fromVersion == PTableVersions.IndexV1) { foreach (var item in _newtable.IterateAllInOrder()) { Assert.IsTrue((ulong)item.Position == item.Stream - 1, "Expected the Stream (Hash) {0} to be equal to {1}", item.Stream - 1, item.Position); } } }
public void remaining_entries_should_have_been_upgraded_to_64bit_hash() { ulong entry1 = 0x0103; ulong entry2 = 0x0102; using (var enumerator = _newtable.IterateAllInOrder().GetEnumerator()) { Assert.That(enumerator.MoveNext()); Assert.That(enumerator.Current.Stream, Is.EqualTo(_upgradeHash(entry1.ToString(), entry1))); Assert.That(enumerator.MoveNext()); Assert.That(enumerator.Current.Stream, Is.EqualTo(_upgradeHash(entry2.ToString(), entry2))); } }
public void no_entries_should_have_upgraded_hashes() { foreach (var item in _newtable.IterateAllInOrder()) { Assert.IsTrue((ulong)item.Position == item.Stream, "Expected the Stream (Hash) {0} to be equal to {1}", item.Stream, item.Position); } }
public void the_items_are_sorted() { var last = new IndexEntry(ulong.MaxValue, long.MaxValue); foreach (var item in _newtable.IterateAllInOrder()) { Assert.IsTrue(last.Key > item.Key || last.Key == item.Key && last.Position > item.Position); last = item; } }
public void the_items_are_sorted() { var last = new IndexEntry(ulong.MaxValue, 0, long.MaxValue); foreach (var item in _newtable.IterateAllInOrder()) { Assert.IsTrue((last.Stream == item.Stream ? last.Version > item.Version : last.Stream > item.Stream) || ((last.Stream == item.Stream && last.Version == item.Version) && last.Position > item.Position)); last = item; } }
public void only_the_32_bit_index_entries_should_have_upgraded_hashes() { foreach (var item in _newtable.IterateAllInOrder()) { if (item.Position >= 0x010900000000) //these are 64bit already { Assert.IsTrue((ulong)item.Position == item.Stream, "Expected the Stream (Hash) {0} to be equal to {1}", item.Stream, item.Position); } else { Assert.IsTrue((ulong)item.Position >> 32 == item.Stream - 1, "Expected the Stream (Hash) {0} to be equal to {1}", item.Stream - 1, item.Position); } } }