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>2018-03-03 02:22:22 +0300
committerJb Evain <jb@evain.net>2018-03-03 02:22:22 +0300
commit3d1ab7dfcd41c0a524bb0fd4ff87dd921c558ed1 (patch)
treeb02c857d65b679a86732f35f2db68bb847ecf719 /Test/Mono.Cecil.Tests
parent73b383e3da40dd6bb649f37621d124fe172c4384 (diff)
Add tests for mdb symbol mismatch
Diffstat (limited to 'Test/Mono.Cecil.Tests')
-rw-r--r--Test/Mono.Cecil.Tests/SymbolTests.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Test/Mono.Cecil.Tests/SymbolTests.cs b/Test/Mono.Cecil.Tests/SymbolTests.cs
index e2bb51c..69cbb99 100644
--- a/Test/Mono.Cecil.Tests/SymbolTests.cs
+++ b/Test/Mono.Cecil.Tests/SymbolTests.cs
@@ -50,6 +50,21 @@ namespace Mono.Cecil.Tests {
Assert.AreEqual (typeof (PortablePdbReader), module.SymbolReader.GetType ());
}, symbolReaderProvider: typeof (DefaultSymbolReaderProvider), symbolWriterProvider: typeof (DefaultSymbolWriterProvider), verify: !Platform.OnMono);
}
+
+ [Test]
+ public void MdbMismatch ()
+ {
+ Assert.Throws<SymbolNotMatchingException> (() => GetResourceModule ("mdb-mismatch.dll", new ReaderParameters { SymbolReaderProvider = new MdbReaderProvider () }));
+ }
+
+ [Test]
+ public void MdbIgnoreMismatch()
+ {
+ using (var module = GetResourceModule ("mdb-mismatch.dll", new ReaderParameters { SymbolReaderProvider = new MdbReaderProvider (), ThrowIfSymbolsAreNotMatching = false })) {
+ Assert.IsNull (module.SymbolReader);
+ Assert.IsFalse (module.HasSymbols);
+ }
+ }
}
}
#endif \ No newline at end of file