private static void VerifyPortableConvertedFromWindowsMatchesExpected(TestResource windows, string expectedMetadata) { var windowsPEStream = new MemoryStream(windows.PE); var windowsPdbStream = new MemoryStream(windows.Pdb); var convertedPortablePdbStream = new MemoryStream(); var converter = new PdbConverter(d => Assert.False(true, d.ToString())); converter.ConvertWindowsToPortable(windowsPEStream, windowsPdbStream, convertedPortablePdbStream); convertedPortablePdbStream.Position = 0; VerifyPortablePdb( convertedPortablePdbStream, SelectAlternative(expectedMetadata, leftAlternative: false), "Comparing Portable PDB converted from Windows PDB with expected metadata"); }
public static void VerifyWindowsConvertedFromPortableMatchesExpected(TestResource portable, string expectedXml, PdbDiagnostic[] expectedDiagnostics, PortablePdbConversionOptions options) { var portablePEStream = new MemoryStream(portable.PE); var portablePdbStream = new MemoryStream(portable.Pdb); var convertedWindowsPdbStream = new MemoryStream(); var actualDiagnostics = new List <PdbDiagnostic>(); var converter = new PdbConverter(actualDiagnostics.Add); converter.ConvertPortableToWindows(portablePEStream, portablePdbStream, convertedWindowsPdbStream, options); AssertEx.Equal(expectedDiagnostics ?? Array.Empty <PdbDiagnostic>(), actualDiagnostics, itemInspector: InspectDiagnostic); VerifyPdb(convertedWindowsPdbStream, portablePEStream, expectedXml, "Comparing Windows PDB converted from Portable PDB with expected XML"); portablePdbStream.Position = 0; convertedWindowsPdbStream.Position = 0; VerifyMatchingSignatures(portablePdbStream, convertedWindowsPdbStream); }
public static void VerifyWindowsPdb(TestResource portable, TestResource windows, string expectedXml, PdbDiagnostic[]?expectedDiagnostics = null, PortablePdbConversionOptions?options = null) { VerifyWindowsMatchesExpected(windows, expectedXml); // TODO: VerifyPortableReadNativelyMatchesExpected(portable, expectedXml); VerifyWindowsConvertedFromPortableMatchesExpected(portable, expectedXml, expectedDiagnostics, options, validateTimeIndifference: false); }
public static void VerifyWindowsPdb(TestResource portable, TestResource windows, string expectedXml, PdbDiagnostic[] expectedDiagnostics = null, PortablePdbConversionOptions options = null) { VerifyWindowsMatchesExpected(windows, expectedXml); VerifyWindowsConvertedFromPortableMatchesExpected(portable, expectedXml, expectedDiagnostics, options); }
public static void VerifyPortablePdb(TestResource portable, TestResource windows, string expectedMetadata) { VerifyPortableMatchesExpected(portable, expectedMetadata); VerifyPortableConvertedFromWindowsMatchesExpected(windows, expectedMetadata); }