diff options
author | Jb Evain <jb@evain.net> | 2017-03-13 02:52:14 +0300 |
---|---|---|
committer | Jb Evain <jb@evain.net> | 2017-03-13 05:17:15 +0300 |
commit | 4ef07a6568edbbda1cc18c95d29b692564dc3b6e (patch) | |
tree | 3b01d2b4a464889db6877069ec0eba7d278b5f57 /Test/Mono.Cecil.Tests | |
parent | 71ee20ba1e70c698f79901724facd2de31298329 (diff) |
Add support for the new embedded compressed ppdb
Diffstat (limited to 'Test/Mono.Cecil.Tests')
-rw-r--r-- | Test/Mono.Cecil.Tests/PortablePdbTests.cs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Test/Mono.Cecil.Tests/PortablePdbTests.cs b/Test/Mono.Cecil.Tests/PortablePdbTests.cs index 34647e9..21cd376 100644 --- a/Test/Mono.Cecil.Tests/PortablePdbTests.cs +++ b/Test/Mono.Cecil.Tests/PortablePdbTests.cs @@ -1,6 +1,6 @@ using System; using System.IO; - +using System.Linq; using NUnit.Framework; using Mono.Cecil.Cil; @@ -315,14 +315,13 @@ namespace Mono.Cecil.Tests { var move_next = state_machine.GetMethod ("MoveNext"); Assert.IsTrue (move_next.HasCustomDebugInformations); - Assert.AreEqual (2, move_next.CustomDebugInformations.Count); - var state_machine_scope = move_next.CustomDebugInformations [0] as StateMachineScopeDebugInformation; + var state_machine_scope = move_next.CustomDebugInformations.OfType<StateMachineScopeDebugInformation> ().FirstOrDefault (); Assert.IsNotNull (state_machine_scope); Assert.AreEqual (0, state_machine_scope.Start.Offset); Assert.IsTrue (state_machine_scope.End.IsEndOfMethod); - var async_body = move_next.CustomDebugInformations [1] as AsyncMethodBodyDebugInformation; + var async_body = move_next.CustomDebugInformations.OfType<AsyncMethodBodyDebugInformation> ().FirstOrDefault (); Assert.IsNotNull (async_body); Assert.AreEqual (-1, async_body.CatchHandler.Offset); @@ -338,10 +337,19 @@ namespace Mono.Cecil.Tests { }); } + [Test] + public void EmbeddedCompressedPortablePdb () + { + TestModule("EmbeddedCompressedPdbTarget.exe", module => { + + }, symbolReaderProvider: typeof (EmbeddedPortablePdbReaderProvider), symbolWriterProvider: typeof (EmbeddedPortablePdbWriterProvider)); + } + void TestPortablePdbModule (Action<ModuleDefinition> test) { TestModule ("PdbTarget.exe", test, symbolReaderProvider: typeof (PortablePdbReaderProvider), symbolWriterProvider: typeof (PortablePdbWriterProvider)); TestModule ("EmbeddedPdbTarget.exe", test, verify: !Platform.OnMono); + TestModule("EmbeddedCompressedPdbTarget.exe", test, symbolReaderProvider: typeof(EmbeddedPortablePdbReaderProvider), symbolWriterProvider: typeof(EmbeddedPortablePdbWriterProvider)); } [Test] |