Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jb@evain.net>2017-08-31 00:21:16 +0300
committerJb Evain <jb@evain.net>2017-08-31 00:21:16 +0300
commitbc39bebc7111662ebcf12952c6a634ab6141ae28 (patch)
treef887118a74be59af735586ac9b786a86dbb9d651
parent22b36c3dc5dcc0ddba38164904a1b3daf02151e2 (diff)
Add test for invalid constants in ppdb
-rw-r--r--Test/Mono.Cecil.Tests/PortablePdbTests.cs15
-rw-r--r--Test/Resources/assemblies/mylib.dllbin0 -> 4608 bytes
-rw-r--r--Test/Resources/assemblies/mylib.pdbbin0 -> 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
new file mode 100644
index 0000000..8d48251
--- /dev/null
+++ b/Test/Resources/assemblies/mylib.dll
Binary files differ
diff --git a/Test/Resources/assemblies/mylib.pdb b/Test/Resources/assemblies/mylib.pdb
new file mode 100644
index 0000000..2f0dfdf
--- /dev/null
+++ b/Test/Resources/assemblies/mylib.pdb
Binary files differ