private static void TestRemoveLabelFromNullByteIndex(ByteSource byteSourceSparse) { byteSourceSparse.IsValidIndex(0).Should().Be(true); byteSourceSparse.Bytes[0].Should().Be(null); byteSourceSparse.Bytes.Should().BeOfType(typeof(StorageSparse <ByteEntry>)); byteSourceSparse.Invoking(x => x.RemoveAllAnnotationsAt(0, ByteSourceLabelProvider.IsLabel)) .Should().NotThrow <NullReferenceException>(); }
// special function. attempts to recurse the graph and collapse all the nodes into // one ByteEntry which represents all of the information about our offset. // // this works in simple cases where you'd only expect i.e. one offset, or bytes are ok // to be overwritten. This doesn't work for more complex stuff like mirrored offsets/etc. // In those cases, you should more manually walk the graph node yourself in whatever manner // is appropriate for the calling code. public static ByteEntry BuildFlatDataFrom(ByteSource byteSource, int index) { if (!byteSource.IsValidIndex(index)) { return(null); } var node = BuildFullGraph(byteSource, index); var finalData = BuildFlatDataFrom(node); return(finalData); }