Esempio n. 1
0
        private static void VerifyPdb(
            this CompilationDifference diff,
            IEnumerable <int> methodTokens,
            string expectedPdb,
            DebugInformationFormat format,
            int expectedValueSourceLine,
            string expectedValueSourcePath,
            bool expectedIsXmlLiteral
            )
        {
            Assert.NotEqual(default(DebugInformationFormat), format);
            Assert.NotEqual(DebugInformationFormat.Embedded, format);

            string actualPdb = PdbToXmlConverter.DeltaPdbToXml(
                new ImmutableMemoryStream(diff.PdbDelta),
                methodTokens
                );

            var(actual, expected) = AdjustToPdbFormat(
                actualPdb,
                expectedPdb,
                actualIsPortable: diff.NextGeneration.InitialBaseline.HasPortablePdb,
                actualIsConverted: false
                );

            AssertEx.AssertLinesEqual(
                expected,
                actual,
                $"PDB format: {format}{Environment.NewLine}",
                expectedValueSourcePath,
                expectedValueSourceLine,
                escapeQuotes: !expectedIsXmlLiteral
                );
        }
Esempio n. 2
0
        private static void VerifyPdb(
            this CompilationDifference diff,
            IEnumerable <int> methodTokens,
            string expectedPdb,
            DebugInformationFormat format,
            int expectedValueSourceLine,
            string expectedValueSourcePath,
            bool expectedIsXmlLiteral)
        {
            Assert.NotEqual(default(DebugInformationFormat), format);
            Assert.NotEqual(DebugInformationFormat.Embedded, format);

            // Include module custom debug info, specifically compilation options and references.
            // These shouldn't be emitted in EnC deltas and we want to validate that.
            string actualPdb = PdbToXmlConverter.DeltaPdbToXml(new ImmutableMemoryStream(diff.PdbDelta), methodTokens, PdbToXmlOptions.IncludeTokens | PdbToXmlOptions.IncludeModuleDebugInfo);

            var(actual, expected) = AdjustToPdbFormat(actualPdb, expectedPdb, actualIsPortable: diff.NextGeneration.InitialBaseline.HasPortablePdb, actualIsConverted: false);

            AssertEx.AssertLinesEqual(
                expected,
                actual,
                $"PDB format: {format}{Environment.NewLine}",
                expectedValueSourcePath,
                expectedValueSourceLine,
                escapeQuotes: !expectedIsXmlLiteral);
        }
Esempio n. 3
0
 public static void VerifyPdb(
     this CompilationDifference diff,
     IEnumerable <MethodDefinitionHandle> methodHandles,
     XElement expectedPdb
     )
 {
     VerifyPdb(diff, methodHandles.Select(h => MetadataTokens.GetToken(h)), expectedPdb);
 }
Esempio n. 4
0
 public static void VerifyPdb(
     this CompilationDifference diff,
     IEnumerable <int> methodTokens,
     string expectedPdb,
     DebugInformationFormat format = DebugInformationFormat.Pdb,
     [CallerLineNumber] int expectedValueSourceLine  = 0,
     [CallerFilePath] string expectedValueSourcePath = null)
 {
     VerifyPdb(diff, methodTokens, expectedPdb, format, expectedValueSourceLine, expectedValueSourcePath, expectedIsXmlLiteral: false);
 }