diff options
author | Jb Evain <jb@evain.net> | 2017-08-31 00:21:16 +0300 |
---|---|---|
committer | Jb Evain <jb@evain.net> | 2017-08-31 00:21:16 +0300 |
commit | bc39bebc7111662ebcf12952c6a634ab6141ae28 (patch) | |
tree | f887118a74be59af735586ac9b786a86dbb9d651 | |
parent | 22b36c3dc5dcc0ddba38164904a1b3daf02151e2 (diff) |
Add test for invalid constants in ppdb
-rw-r--r-- | Test/Mono.Cecil.Tests/PortablePdbTests.cs | 15 | ||||
-rw-r--r-- | Test/Resources/assemblies/mylib.dll | bin | 0 -> 4608 bytes | |||
-rw-r--r-- | Test/Resources/assemblies/mylib.pdb | bin | 0 -> 416 bytes |
3 files changed, 14 insertions, 1 deletions
diff --git a/Test/Mono.Cecil.Tests/PortablePdbTests.cs b/Test/Mono.Cecil.Tests/PortablePdbTests.cs index 3e1634e..208c277 100644 --- a/Test/Mono.Cecil.Tests/PortablePdbTests.cs +++ b/Test/Mono.Cecil.Tests/PortablePdbTests.cs @@ -399,7 +399,7 @@ namespace Mono.Cecil.Tests { var symbol = method.DebugInformation; Assert.IsNotNull (symbol); - Assert.AreEqual(1, symbol.Scope.Constants.Count); + Assert.AreEqual (1, symbol.Scope.Constants.Count); var a = symbol.Scope.Constants [0]; Assert.AreEqual ("a", a.Name); @@ -407,6 +407,19 @@ namespace Mono.Cecil.Tests { } [Test] + public void InvalidConstantRecord () + { + TestModule ("mylib.dll", module => { + var type = module.GetType ("mylib.Say"); + var method = type.GetMethod ("hello"); + var symbol = method.DebugInformation; + + Assert.IsNotNull (symbol); + Assert.AreEqual (0, symbol.Scope.Constants.Count); + }, symbolReaderProvider: typeof (PortablePdbReaderProvider), symbolWriterProvider: typeof (PortablePdbWriterProvider)); + } + + [Test] public void SourceLink () { TestModule ("TargetLib.dll", module => { diff --git a/Test/Resources/assemblies/mylib.dll b/Test/Resources/assemblies/mylib.dll Binary files differnew file mode 100644 index 0000000..8d48251 --- /dev/null +++ b/Test/Resources/assemblies/mylib.dll diff --git a/Test/Resources/assemblies/mylib.pdb b/Test/Resources/assemblies/mylib.pdb Binary files differnew file mode 100644 index 0000000..2f0dfdf --- /dev/null +++ b/Test/Resources/assemblies/mylib.pdb |