public void CheckInvalidHeadersFail(string doc) { using (var s = new MemoryStream(Encoding.UTF8.GetBytes(doc))) { var perfMap = new PerfMapFile(s); Assert.True(!perfMap.IsValid); } }
public void CheckRecords() { using (var s = new MemoryStream(Encoding.UTF8.GetBytes(s_validV1PerfMap))) { var perfMap = new PerfMapFile(s); PerfMapFile.PerfMapRecord record = perfMap.PerfRecords.Single(); Assert.True(record.Rva == 0x115D0); Assert.True(record.Length == 0x0D); Assert.True(record.Name == "Microsoft.CodeAnalysis.EmbeddedAttribute::.ctor()"); } }
public void CheckIndexingInfo() { using (var s = new MemoryStream(Encoding.UTF8.GetBytes(s_validV1PerfMap))) { var perfMap = new PerfMapFile(s); Assert.True(perfMap.IsValid); Assert.True(perfMap.Header is not null); Assert.True(TestHelpers.TestUtilities.ToHexString(perfMap.Header.Signature) == "734d59d6de0e96aa3c77b3e2ed498097"); Assert.True(perfMap.Header.Version == 1); } }
public void CheckRecordsVNextFail() { // Reading the vNext records is invalid as . using (var s = new MemoryStream(Encoding.UTF8.GetBytes(s_VNextPerfMapValid))) { var perfMap = new PerfMapFile(s); Assert.True(perfMap.IsValid); Assert.True(perfMap.Header is not null); Assert.True(perfMap.Header.Version == 99); Assert.Throws <NotImplementedException>(perfMap.PerfRecords.First); } }
public void CheckFields() { using (var s = new MemoryStream(Encoding.UTF8.GetBytes(s_validV1PerfMap))) { var perfMap = new PerfMapFile(s); Assert.True(perfMap.IsValid); Assert.True(perfMap.Header is not null); Assert.True(TestHelpers.TestUtilities.ToHexString(perfMap.Header.Signature) == "734d59d6de0e96aa3c77b3e2ed498097"); Assert.True(perfMap.Header.Version == 1); Assert.True(perfMap.Header.OperatingSystem == PerfMapFile.PerfMapOSToken.Linux); Assert.True(perfMap.Header.Architecture == PerfMapFile.PerfMapArchitectureToken.X64); Assert.True(perfMap.Header.Abi == PerfMapFile.PerfMapAbiToken.Default); } }
public void CheckHeaderVNext() { // Reading the vNext header is valid as long as the signature and fields remain compatible. using (var s = new MemoryStream(Encoding.UTF8.GetBytes(s_VNextPerfMapValid))) { var perfMap = new PerfMapFile(s); Assert.True(perfMap.IsValid); Assert.True(perfMap.Header is not null); Assert.True(TestHelpers.TestUtilities.ToHexString(perfMap.Header.Signature) == "734d59d6de0e96aa3c77b3e2ed498097"); Assert.True(perfMap.Header.Version == 99); Assert.True(perfMap.Header.OperatingSystem == PerfMapFile.PerfMapOSToken.Linux); Assert.True(perfMap.Header.Architecture == PerfMapFile.PerfMapArchitectureToken.X64); Assert.True(perfMap.Header.Abi == PerfMapFile.PerfMapAbiToken.Default); } }
public PerfMapFileKeyGenerator(ITracer tracer, SymbolStoreFile file) : base(tracer) { _file = file; _perfmapFile = new PerfMapFile(_file.Stream); }